Skip to content

Commit f63bb81

Browse files
authored
Update crud-controller.stub
1 parent f9c31a9 commit f63bb81

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Console/stubs/crud-controller.stub

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,27 @@ class DummyClassCrudController extends CrudController {
8989
// $this->crud->addClause('whereHas', 'posts', function($query) {
9090
// $query->activePosts();
9191
// });
92+
// $this->crud->with(); // eager load relationships
9293
// $this->crud->orderBy();
9394
// $this->crud->groupBy();
9495
// $this->crud->limit();
9596
}
9697

9798
public function store(StoreRequest $request)
9899
{
99-
return parent::storeCrud();
100+
// your additional operations before save here
101+
$redirect_location = parent::storeCrud();
102+
// your additional operations after save here
103+
// use $this->data['entry'] or $this->crud->entry
104+
return $redirect_location;
100105
}
101106

102107
public function update(UpdateRequest $request)
103108
{
104-
return parent::updateCrud();
109+
// your additional operations before save here
110+
$redirect_location = parent::updateCrud();
111+
// your additional operations after save here
112+
// use $this->data['entry'] or $this->crud->entry
113+
return $redirect_location;
105114
}
106115
}

0 commit comments

Comments
 (0)