![ChatGPT Laravel API Package for Laravel](https://laravelsage.com/storage/media/26/conversions/ChatGpt-Laravel-responsive.jpg)
ChatGPT Laravel API Package for Laravel
The ChatGPT Laravel API Package Generator package for Laravel generates smart API mocks in Laravel using ChatGPT prompts:
1 min read
Tags:
Since Laravel version 10.15, there is a new utility function called data_forget that allows you to remove keys from an array or object using a "dot" notation.
Here is how the data_forget helper works:
$data = [
'people' => [
'john' => ['address' => '123 main', 'state' => 'nc'],
'michael' => ['address' => '34 east 5th', 'state' => 'ny']
]
];
data_forget($data, 'people.*.address');
The data_forget
function removes the 'address' attribute from both the "john" and "jane" sub-array. The result will then be:
[
'people' => [
'john' => ['state' => 'nc'],
'michael' => ['state' => 'ny']
]
];
One of the neat features of the data_forget
helper is its flexibility. It supports wildcard characters and complete 'dot' notation.
For instance, in the example above, the wildcard character (*) is used in the key string, specifying any sub-key under 'name'. Alternatively, if you need to remove a key from a specific sub-array, you can do so using the complete 'dot' notation, like so:
data_forget($data, 'people.john.address');
To learn more about the data_forget
helper function, you can refer to the PR on Github.
Full-stack developer with a knack for Merging creativity with technical expertise for standout solutions.
The ChatGPT Laravel API Package Generator package for Laravel generates smart API mocks in Laravel using ChatGPT prompts:
You can make your Laravel app multi-tenant using the Tenancy for Laravel Tenant package. This tenancy package lets you make any Laravel application multi-tenant without rewriting it.
Are you ready to take your Laravel skills to the next level and build extraordinary applications? Look no further! In this blog post, we will unveil a treasure trove of top packages that will revolutionize your development process.
The Livewire Tables package brings dynamic tables for models to Laravel Livewire. These are some of the features which you will get out of the box:
Laravel Translations UI is a package that provides a simple and friendly user interface for managing translations in a Laravel app.
Postal mail server might be the perfect solution for managing your mail server if you're looking for a robust, open-source solution.
Subscribe for 20+ new Laravel tutorials every week
You can unsubscribe at any time. You'll also get -20% off my courses!