routing Flashcards

1
Q

get/post method

A

Route::get(‘/post’,[ControllerName::class,’methodName’])->name(‘post.create’)

Route::post(‘/post’,[ControllerName::class,’methodName’])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Token in Laravel For Security

A

input type=”hidden” name=”_token” value=”{{ csrf_token( ) }}”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Auth Group

A

Route::middleware(‘auth’)->group( function( ){

Route you want to authorize

} )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

routing methods

A
Route::get($uri, $callback);
Route::post($uri, $callback);
Route::put($uri, $callback);
Route::patch($uri, $callback);
Route::delete($uri, $callback);
Route::options($uri, $callback);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

optional parameters

A

Route::get(‘/user/{name?}’, function ($name = null) {
return $name;
});

Route::get(‘/user/{name?}’, function ($name = ‘John’) {
return $name;
});

How well did you know this?
1
Not at all
2
3
4
5
Perfectly