Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How change view folder in Laravel5?

I am developing an web application using Laravel 5 and AngularJS. I am using pure angularJS app for the client side and I am putting the client app files (views) in my public folder.

In Laravel 4, I could change the path from the bootstrap/start.php file. But in Laravel 5, I can not see the start.php file. So where do I change the configuration in Laravel 5?

like image 558
gsk Avatar asked Mar 04 '15 06:03

gsk


People also ask

How do I change the view directory in Laravel?

1 Answer. Show activity on this post. 'paths' => [ realpath(base_path('resources/views')) ], So you might change it to realpath(base_path('public/assets/views')) to be in your public path.

Is it possible to rename views folder in Laravel?

There is currently no way to change the public directory even though you can change $app['path'] and $app['path.

Where is view folder in Laravel?

Views are stored in the resources/views directory. return view('greeting', ['name' => 'James']); }); As you can see, the first argument passed to the view helper corresponds to the name of the view file in the resources/views directory.


1 Answers

See line 16 of config/view.php (the "View Storage Paths" section)

'paths' => [
    realpath(base_path('resources/views'))
],

So you might change it to realpath(base_path('public/assets/views')) to be in your public path.


Additional Examples

'paths' => [

    // src/MyNamespace/resources
    realpath(base_path('src/MyNamespace/resources')),

    // app/resources
    realpath(app_path('resources'))

],
  • You can provide multiple search locations
  • You can use app_path(), base_path(), or neither.
like image 114
Andy Fleming Avatar answered Oct 12 '22 23:10

Andy Fleming