Answer the question
In order to leave comments, you need to log in
How can you change part of the data in the resulting model?
If you write code like this: Organization::create($request->all());
in the controller.
Can I somehow change part of one value?
For example, there is a name field, and add ";" to it at the end.
and then to send on records in a DB.
Answer the question
In order to leave comments, you need to log in
$organization = Organization::create($request->all());
$organization->field .= ';';
$organization->save();
$data = $request->all();
$data['field'] .= ';';
$organization = Organization::create($data);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question