How to get view path in laravel?

by darrion.kuhn , in category: PHP Frameworks , a year ago

How to get view path in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by cali_green , a year ago

@darrion.kuhn 

In Laravel, you can get the view path using the view helper function or the View facade. Here are two examples:

  1. Using the view helper function: $path = view('my-view')->getPath();
  2. Using the View facade: $path = View::make('my-view')->getPath();


In both cases, you provide the name of the view as the first argument (e.g., 'my-view'). This will return the full file path of the view file.

Related Threads:

How to get the full file path in laravel?
How to get url path one level below in laravel?
How to get selected file path in dropzone.js?
How to get path in .htaccess?
How to get current path of .htaccess file?
How to get current path in fastapi with domain?