View [index] not found in laravel - php

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

Related

Laravel - application showing old views after making changes

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?

View not found error after deploying Laravel app on Heroku

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

laravel new project not running still loading in browser

installing laravel new project
composer create-project --prefer-dist laravel/laravel newProject
Project running perfect in http://localhost:8000/ in this port
after some time page loading stil
and clear everything in this project i think its cache error
php artisan cache:clear
php artisan config:clear
php artisan view:clear
project running for 2 min then still again loading
then this project change port like
php artisan serve --port 9000
same as working for 2 or 3 min then still loading
i dont know whats problem in this project any idea for this ?
i tried same project on my second system working fine
Route::get('/user', 'YourController#YourControllerFunction')->middleware('auth');
Or if you have many api's that need to use the authentication middleware then create a group like:
Route::group(['middleware' => 'auth'], function () {
Route::get('/user', 'YourController#YourControllerFunction');
});
Also keep in mind that the auth:api middleware requires a token to be generated for user authentication.
Yah i got a answer
its not a php error operating system problem
thats why auto remove server.php file in my project
Its better solution is update your operating system
php artisan serve manually serve project its working fine like php -S localhost:8000 -t path

Laravel - reading config variable

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'));

Laravel requesting local file in server (file_put_contents)

I am developing a Laravel app, it was all good until I uploaded to the server, then I got this error
file_put_contents(/home/vagrant/sites/controltienda/storage/framework/sessions/Gm7GMQ0Lb5c2PSMWatoZZrVf6XvTXxOnF0PJB9RH): failed to open stream: No such file or directory
I don't know why it is requesting some file from my local drive which obviously it is not present, I already tried the following:
php artisan route:clear
php artisan route:cache
composer dump-autoload
php artisan cache:clear
Without much success. How can I fix this?
so i keep goin on search and i found this older question Laravel wrong view path. I ran php artisan config:cache and that's all folks.
Thanks for replay.

Categories