G
G
ganjo8882018-12-20 10:27:30
Laravel
ganjo888, 2018-12-20 10:27:30

How to record a route?

Route::get('/admin/resource','[email protected]', function (){

    return view('welcome');
})->name('resourceForm');

I know it's not right. I want to call the controller and view at the same time, how to write it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
seraskir161, 2018-12-20
@seraskir161

Route::get('/admin/resource', '[email protected]')->name('resourceForm');

class ContentController {
    public function saveContent() {
        return view('welcome');
    }
}

or
Route::get('/admin/resource', function () {
    return view('welcome');
})->name('resourceForm');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question