LoginSignup
0
0

More than 1 year has passed since last update.

laravel ルートnameを使ってパスを取得する方法

Last updated at Posted at 2022-08-07

概要

  • laravelのroute()とPHPのparse_url()を用いてルートnameからパスを取得する方法をまとめる。
  • 自分なりの方法です。もっといい方法あったらコメントいただけますと幸いです。。!

方法

  • 下記のように記載する。

    $path = parse_url(route('ルートname'), PHP_URL_PATH);
    
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0