Answers for "laravel add attribute to query"

PHP
1

how to add attribute to the request object in laravel

//this is my code

this how to add single attribute to the request object in laravel:-
  
$request->request->add(['car' => 'value']); 

this is how to add multiple attributes to the request object in laravel:-
$request->request->add(['car' => 'value',  'end' => 'done']);
Posted by: Guest on November-18-2021
1

laravel add attribute to model

$user = User::find(1);

// add occupation to user instance
$user->setAttribute('occupation', 'Web Developer');
Posted by: Guest on January-22-2021

Code answers related to "laravel add attribute to query"

Browse Popular Code Answers by Language