Laravel Artisan Helper Function

[Solved] Laravel Artisan Helper Function | Php - Code Explorer | yomemimo.com
Question : laravel artisan helper function

Answered by : abdo-shokrey

use Illuminate\Support\Arr;
 
$array = Arr::add(['name' => 'Desk'], 'price', 100);
 
// ['name' => 'Desk', 'price' => 100]
 
$array = Arr::add(['name' => 'Desk', 'price' => null], 'price', 100);
 
// ['name' => 'Desk', 'price' => 100]

Source : https://laravel.com/docs/9.x/helpers#method-array-accessible | Last Update : Tue, 07 Jun 22

Answers related to laravel artisan helper function

Code Explorer Popular Question For Php