App works fine on local server but on heroku it gives following error
InvalidArgumentException:
View [index] not found.
Route is set as:
Route::get('/', function () {
return view('index');
});
index.blade.php also exists in views folder
I have tried following:
Removed cache files from storage/framework/views
php artisan view:clear
php artisan route:cache
php artisan config:cache
php artisan key:generate
Any help please?
you already done php artisan config:cache or php artisan config:clear
Did you name your view correctly as yourview.blade.php?
Did you place the view correctly in resources\views
You can save yourself time clearing caches by writing this one command any time you're having doubts:
php artisan optimize:clear
Related
I am working on a Laravel template. I have made changes in the public folder while using xampp.
however, when I upload the project to live hosting, the application is showing the old unchanged view but it loads properly when I load it with xampp
I have tried clearing commands but no luck:
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache
Please how can I get past this issue?
Hello i am new to laravel but i can't discover why i can't acess to my default path
My route:
Route::get('/', 'HomeController#home');
My controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function home()
{
return view('home.home');
}
}
My route list
I have try with diferent middlewares and also i have change this api.route
i have delete this:
//Route::middleware('auth:api')->get('/user', function (Request $request) {
// return $request->user();
//});
Please help i am start going crazy.
Solved my same problem just with command:
php artisan route:clear
in my case:
php artisan optimize
php artisan optimize:clear
solve the problem
It works for me
php artisan optimize:clear
php artisan route:clear
If you're facing this problem, simply run this command
php artisan optimize
The above command will clear all routes, files and configurations and also go ahead to create new cache for them.
Try using the following commands:
php artisan cache:clear
php artisan route:cache
php artisan config:cache
php artisan view:clear
in my case i solve this issue with run : php artisan cache:clear command 4 times.
more usefull command :
php artisan cache:clear # for clear your application cache.
php artisan route:cache # for clear your application route cache.
php artisan config:cache # you should cache all of your configuration files into a single file
php artisan view:clear # if you want to
clear view cache
the best way for solving this problem is to clear route cache through
php artisan route:clear
I have tried many methods but did not get to the right solution however did not lose the heart and try php artisan route:clear
I'm getting a BadMethodCallException in laravel 5.6 when i login and logout users, I don't know where this behavior came from, I'm using the auth scaffolding that ships with laravel.
Login
Method Illuminate\Database\Query\Builder::setCache does not exist.
Logout
Method Illuminate\Database\Query\Builder::pullCache does not exist.
I've tried to run all cache commands $ php artisan clear:cache
I'm using the basic routing and controller that comes with the command
Auth::routes();
It happens due to the cache issue in Laravel. In any case, running following commands should fix your issue:
php artisan view:clear
php artisan route:clear
php artisan cache:clear
php artisan config:clear
composer dump-autoload
my website run correctly at localhost but when i upload it on CPanel it makes a mistake and say me view index not found
InvalidArgumentException View [index] not found.
this is my Route Code:
Route::get('/', function () {
return view('index');
});
Also i executed these commands:
php artisan config:cache
php artisan config: clear
php artisan view:clear
composer update
php artisan route:clear
but it have no response!!!!!
What's your resources/views directory's permission? It should accessible by your web server.
You should try : php artisan cache:clear
If these commands work:
php artisan config:cache or php artisan
config:clear?
named your view correctly with yourview.blade.php?
placed the view correctly in the resources\views?
Maybe the problem is that your server is not setting up properly because the domain doesnt connected properly to your VPS. Contact the hosting provider.
i solved it, i upload new project and it solved but i don't know what is the issue of last project. It's so weird
I don't get it - when I search for this problem I get told to do the followng:
composer dump-autoload
php artisan config:clear
php artisan cache:clear
php artisan view:clear
And yet it is not making a difference. In my .env file:
PASS_DOMAIN=domain.local
In my /config/app.php file:
'pass_domain' => env('PASS_DOMAIN', 'example.com'),
Yet in my middleware located in /app/Http/Middleware/ if I place the following:
dd(config('pass_domain'));
I get nothing. Why cant I access this variable? Originally I had env('pass_domain') but nothing is letting me see this damn variable.
Any help?
Try this
dd(config('app.pass_domain'));