Creating URLs using the route action/handler

By @samuel · 2021-11-01 18:57

Creating URLs using the route action/handler

  • By @ralphjsmit · 2021-11-09 13:27

    Okay! So with this routes file:

    Route::get('/user', [PostController::class, 'index'])->name('prefix.user.index');
    

    This:

    route('prefix.user.index'); 
    

    is giving the same as this:

    url()->action([PostController::class, 'index']);
    

    ?

    • By @samuel · 2021-11-09 13:49

      Yeah, should be the same thing. You can test that in tinker to check.