Answered by : beautiful-bird-yr4geyht6l12
Route::currentRouteName()
Source : https://stackoverflow.com/questions/30046691/laravel-how-to-get-current-route-name-v5-v7 | Last Update : Fri, 31 Jul 20
Answered by : martin-mladenov-2lnvs7ib3riv
request()->route()->getName()
Source : | Last Update : Fri, 28 May 21
Answered by : hirohito
get URL:
{{ Request::url() }} // http://localhost/path
get path:
{{ Request::path() }} // path
Source : | Last Update : Mon, 30 Aug 21
Answered by : tiago-frana
Route::currentRouteName()
Route::getCurrentRoute()->getPath();
\Request::route()->getName()
Route::currentRouteName(); //use Illuminate\Support\Facades\Route;
Route::getCurrentRoute()->getActionName();
$uri = $request->path();
Source : | Last Update : Sun, 12 Dec 21
Answered by : maniruzzaman-akash
use App\Http\Controllers\PagesController;
// Create route for About Page
Route::get('about-us', [PagesController::class, 'aboutPage'])->name('pages.about');
Source : https://devsenv.com/tutorials/basic-about-laravel-routing | Last Update : Sat, 10 Jul 21
Answered by : adventurous-ant-u6vb73sfof7g
Route::getCurrentRoute()->getActionName();
Source : https://stackoverflow.com/questions/30046691/laravel-how-to-get-current-route-name-v5-v7 | Last Update : Wed, 02 Sep 20
Answered by : cooperative-crab-qq95wr7pe6oz
$route = Route::current();
$name = Route::currentRouteName();
$action = Route::currentRouteAction();
Source : https://laravel.com/docs/5.4/routing | Last Update : Sat, 31 Jul 21
Answered by : tiago-frana
\Route::currentRouteName() == 'my_route_name'
Source : | Last Update : Sun, 12 Dec 21