Laravel: Error InvalidArgumentException - php

I' upload the project from localhost to my dedicated server and after so many problems, finally some pages works domain.com | domain.com/home | domain.com/allsites etc..
But now, the routes "domain.com/site/create"
"domain.com/site/ID/manage", "domain.com/site/ID/edit" not found, i get this error, why?
InvalidArgumentException in FileViewFinder.php line 137: View [Site.create] not found.
in FileViewFinder.php line 137 at
FileViewFinder->findInPaths('Site.create',
array('/....../resources/views')) in FileViewFinder.php line 79 at
FileViewFinder->find('Site.create') in Factory.php line 151
I try artisan comands: cache:clear, route:clear, config:clear, config:cache and nothings works, i don't know where is the problem!
On localhost it works perfectly

also multiple times its found that config cache being problem. Use following commands to finetune them.
php artisan config:cache
php artisan config:clear

If your local OS is different from your production server OS you might be running into a case-sensitive issue and the file is not being found. make sure your files names are EXACTLY the same, case and all. This can happen especially if one environment is Mac and the other is Linux.
If the issue is not fixed, please go through the following link. It may help you
Laravel 5 - View [home] not found
Laravel 5.1 View not found
Laravel 5 InvalidArgumentException in FileViewFinder.php line 137: View [.admin] not found

I had same issue but cause was different. For me the problem was permissions on errors folder. In particular the folder was not executable.
To resolve on linux:
$ chmod +x ../views/errors

Try one of these commands:
php artisan dump-autoload or composer dump-autoload

check you passed argument are in database fields or not!
$mailData = array(
'type' => 'email_subscription',
'user_mail' => $obj->email_id
);
Mail::to($request->input('email'))->send(new SendMail($mailData));

Related

Laravel cannot find public dir

I worked on a team and then clone the laravel/php codes from our repository. When I serve the laravel on localhost, it cannot find all the file inside the public directory and throw an error on the terminal:
[404]: GET /public/css/style.css - No such file or directory
Many answers to similar issues advise me to change the codes in the blade.php file. The problem is that I can't edit the blade.php because it works fine on other team members even though we have the same ubuntu, PHP, and laravel version and .env file.
What I have tried:
Run composer install and composer update
Try different browsers such as firefox and chromium-based browsers
Run php artisan storage:link
Restart apache2
Run npm install and npm run dev
I think there is some package or something missing.
List of paths I get from dd($__data):
"path" => "/project-directory/project-name/app"
"path.base" => "/project-directory/project-name"
"path.lang" => "/project-directory/project-name/resources/lang"
"path.config" => "/project-directory/project-name/config"
"path.public" => "/project-directory/project-name/public"
"path.storage" => "/project-directory/project-name/storage"
"path.database" => "/project-directory/project-name/database"
"path.resources" => "/project-directory/project-name/resources"
"path.bootstrap" => "/project-directory/project-name/bootstrap"
Have you tried?
php artisan storage:link
You need first run
php artisan storage:link
For more details check https://laravel.com/docs/8.x/filesystem
Then you must be check your .env values.
Is correctly APP_URL=
Also in your exception is strange
/public/.../...
Reason is wrong configuration.
First check your .env values like
APP_URL=...
FILESYSTEM_DRIVER=public
then check config/filesystems.php

php artisan serve not working giving error In ProviderRepository.php line 208:Class 'Laravelium\Sitemap\SitemapServiceProvider' not found

I'm working for the first time in laravel while setting up the already developed project in my local computer and running php artisan serve i'm getting this error
In ProviderRepository.php line 208:
Class 'Laravelium\Sitemap\SitemapServiceProvider' not found
Issue is resolved by just follow these step. Go to your project > bootstrap->cache->config.php remove the provider and aliases from the cached array manually.

Docker+Laravel installation

I use CentOS 7 for a little pjojekt with Docker and Laravel. Used a tutorial (https://tecadmin.net/install-laravel-framework-on-centos/#) for the instalation and I dont dont know why but something gone wrong within the 5th Step. The terminal says this:
[root#docker laravel]# php artisan key:generate
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/laravel/artisan on line 31
And in the artisan line 31 is this:
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
If someone has an idea the please help.
I want after installing Laravel combine Docker and Laravel with Laradock i hope this will not go wrong like this
Thanks Moritz
I had the same error, for me it was a permission issue.
From the laravel docs(source: https://laravel.com/docs/5.4/installation):
Directory Permissions
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run.
So try changing the permissions on your host machine and see if it works.

NotFoundHttpException in RouteCollection.php line 161 laravel 5.2

I'm new on laravel , I didn't write any code yet but when I open my project it gives me this error , anyone can help me to solve it ?
[
Just try http://localhost:8000 since it seems like you already started development server in your local machine using php artisan serve while you were on your project root via terminal.
Or you can try from begining:
Go to your project root from terminal / cmd
Run php artisan serve
Now try http://localhost:8000 which is equivalent to http://localhost/laravel/public , considering laravel is your project folder name.

Cannot start artisan serve in laravel 5

I am using laravel 5, when I try to start server from
php artisan serve
I get following error :
[Symfony\Component\Debug\Exception\FatalErrorException]
App\Providers\RouteServiceProvider::App\Providers{closure}(): Failed
opening required 'D:\Test\app\app\Http/routes.php'
(include_path='.;C:\xampp\php\pear')
I tried composer dump-autoload, it was successfull, but when i do
composer update
I get the same error.
How to resolve it?
routes.php was never in app\Http, it was in someother dir. Moving it back where it belongs fixed the issue

Categories