Answer the question
In order to leave comments, you need to log in
How to be removed Route::controller in Laravel 5.3?
Before version 5.3, I had this CRUD :
public function getIndex()
public function getForm($id = null)
{
if ($id) {
$category = Category::find($id);
} else {
$category = [];
}
return view('backend.categories.form', compact('category'));
}
public function postForm(Request $request, $id = null)
{
$data = $request->except('_token');
$data['alias'] = $this->aliasCreate($data['name']);
if ($id) {
$category = Category::find($id)->update($data);
} else {
$category = Category::create($data);
}
Session::flash('success', 'Success');
return Redirect::action('Backend\[email protected]');
}
public function getDelete($id)
{
// тут delete
}
private function aliasCreate($value)
{
// тут создаем alias
}
Answer the question
In order to leave comments, you need to log in
controller was cut out to remove non-obviousness, i.e. magic controllers that do not know what.
Now you need to explicitly specify everything, or use resource (which, by the way, you haven’t even tried, since you don’t know that there are generally rigid frameworks, and you won’t use it especially in any way).
So now only:
Router::get('func', '\App\Http.....');
Router::post('func', '\App\Http.....');
etc.
every controller method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question