Answer the question
In order to leave comments, you need to log in
Why does $model->save() not work on the same input data, but Model::create() does?
Hello.
Why does it work like this:
public function store(Ticket $ticket, Request $request)
{
//$ticket->save($request->all());
Ticket::create($request->all());
return redirect()->route('tickets.main')
->with('success','Ваш запрос в службу поддержки зарегистрирован!');
}
<form class="form" action="{{ route('tickets.store') }}" method="POST">
@csrf
@method('POST')
Answer the question
In order to leave comments, you need to log in
Set up in the model $fillable
? Also, the method save()
can't take parameters like you do. Must be called $model->fill($data)->save();
.
https://laravel.com/docs/5.7/eloquent#inserting-an...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question