How to change the views file path in laravel? helps of this example you will change your blade file views path in your laravel application. by default application blade file path is resources/views, So if you want to change the blade file this post will help to change.
To change the default blade file path from the resources views to another directory, we need to change the little default laravel application configuration. therefore we need to open the view.php file inside the config available.
Open the view.php file, and there will be a paths attribute, this path is already in resources, as you can see in your application. just add your new blade file there and dump your application. see below given example.
config/view.php<?php return [ /* |-------------------------------------------------------------------------- | View Storage Paths |-------------------------------------------------------------------------- | | Most templating systems load templates from disk. Here you may specify | an array of paths that should be checked for your views. Of course | the usual Laravel view path has already been registered for you. | */ 'paths' => [ resource_path('views'), // ADD NEW BLADE FILE PATH HERE ], /* |-------------------------------------------------------------------------- | Compiled View Path |-------------------------------------------------------------------------- | | This option determines where all the compiled Blade templates will be | stored for your application. Typically, this is within the storage | directory. However, as usual, you are free to change this value. | */ 'compiled' => env( 'VIEW_COMPILED_PATH', realpath(storage_path('framework/views')) ), ];
We always thanks to you for reading our blogs.
Dharmesh Chauhan
(Swapinfoway Founder)Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us
Haresh Chauhan
(Co-Founder)We Are Also Recommending You :
- Error : Array to string conversion Laravel
- Laravel 10 PDF Export Example With DomPDF
- How To File Upload AWS s3 Bucket In Laravel 9
- Laravel Country State City Dropdown Using AJAX
- Laravel Adding Social Media Share buttons Advanced Tutorial Example
- Laravel Debugging Methods With Example
- Everything know about Laravel Localization With Demo Example
- Laravel 10 Breeze Integration Tutorial Example
- How to hide image URL from IMG tag src laravel
- Custom Validation Message Laravel