Answer the question
In order to leave comments, you need to log in
Am I populating the model correctly with values?
There is a form that the user fills out. on the back there is a request to the action, and I have this:
Descriptor::create(['user_id' => Auth::id(), 'message' => $all['message']]);
Answer the question
In order to leave comments, you need to log in
You can make a method that accepts a user as input, and then executes
Descriptor::create(['user_id' => $user->id, 'message' => $all['message']]);
then this method will be more universal and it will be more convenient to test. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question