Answers for "collection remove null laravel"

PHP
1

laravel on delete set null

$table->...->onDelete('set null');

#First make sure you set the foreign key field as nullable:
$table->integer('foreign_id')->unsigned()->nullable();
Posted by: Guest on March-01-2021
1

laravel collection remove item

forget()
The forget method removes an item from the collection by its key:

$collection = collect(['name' => 'taylor', 'framework' => 'laravel']);

$collection->forget('name');

$collection->all();

// ['framework' => 'laravel']

Another example

$permissions->forget([2, 3, 4]);

Source 
https://laravel.com/docs/8.x/collections#method-forget
Posted by: Guest on May-19-2021

Code answers related to "collection remove null laravel"

Browse Popular Code Answers by Language