Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

push key and value in laravel

public function index()
{
    $collection = collect(['id' => 1, 'name' => 'Hardik']);
  
    $collection->put('role', 'admin');
   
    $collection->all();
      
    dd($collection);
}
Source by www.itsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #push #key #laravel
ADD COMMENT
Topic
Name
3+1 =