-
Notifications
You must be signed in to change notification settings - Fork 288
Closed
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomersin progressThis issue is being worked on.This issue is being worked on.
Description
I couldn't find any Controller@update
method example in the docs, only store()
.
Although the docs say that Blueprint supports update
statement, I couldn't make it work.
My draft.yaml
models:
Program:
title: string
controllers:
Program:
store:
validate: title
save: program
redirect: program.show
update:
validate: title
save: program # I have tried `update: program`, too
redirect: program.show
Generated controller methods:
public function store(ProgramStoreRequest $request)
{
$program = Program::create($request->all());
return redirect()->route('program.show', ['program' => $program]);
}
public function update(ProgramUpdateRequest $request, Program $program)
{
$program->save(); // When I use `update: program` there's no action at all, just a redirect.
return redirect()->route('program.show', ['program' => $program]);
}
What am I missing here?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomersin progressThis issue is being worked on.This issue is being worked on.