Laravel 5 cache folder name causing classloader.php 412 error - laravel-5

When I uploaded my laravel 5 application to hostgator, i changed the name of one of the folders (instructor) that contains some controllers to (Instructors). However, I'm getting the error ErrorException in ClassLoader.php line 412
the applications is looking for controllers under the old folder name (instructor).
How can i fix this issue please?
Thank you

You can run the following command:
composer dumpautoload

perhaps u don't have controller.php file in the controllers folder under http folder of ur project.
Look for this file first..because in this file controller itself gets extended from basecontroller class, therefore it is necessary that this file should be there.

Related

why can't resolve the required file Laravel on on my hosting server?

I'm trying to connect the folder public with Laravel but I can't
API is in another folder called Laravel01
I've changed the url on index.php
require __DIR__.'/../laravel01/vendor/autoload.php';
but I can't step back to the root folder
Fatal error: require(): Failed opening required '/homepages/15/d831964969/htdocs/api/../laravel01/vendor/autoload.php' (include_path='.:/usr/lib/php7.4') in /homepages/15/d831964969/htdocs/api/index.php on line 24
it keeps on api folder when it must link with laravel01 folder
sorry for my English and I hope everybody can understand me, thanks a lot

Change root folder name

My Laravel project folder was "laravel" so i changed to "testsite", but now i cant access the site.
InvalidArgumentException in FileViewFinder.php line 137: View [pages.home] not found.
ErrorException in Filesystem.php line 109: file_put_contents(C:\Users\Zen\Google Drive\xampp\laravel\storage\framework/sessions/4d5b7c28f025c192658893a77c2d6bdb60b33d48): failed to open stream: No such file or directory
Full error can be found here:
PasteBin
Its visible in the paste that is something related with sessions from the old folder "laravel".
Using Xampp with virtualhosts, restarted Xampp, cleared browser cache, it didint solved the issue.
How can i fix this issue?
Problem solved, has described here: Laravel 5.1 View not found
php artisan cache:clear
php artisan config:cache
You have an inconsistent path, take a look of how you're setting the slashes:
xampp\laravel\storage\framework/sessions/
Besides that, make sure that the framework/session folder exists
Also check that pages.home hierarchy exists in your views folder:
View [pages.home] not found

Laravel 5.1 NotFoundHttpException in RouteCollection.php line 161

I have an error which you can see in this picture, and I don't know how to fix it. I am using Laravel 5.1.
Error:
Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161
Either make your route something like in your Routes.php file from App\Http folder
Route::get('/laravel/alert/',function(){
//statement here
});
or change your page url to localhost/alert
Hope it will help you.
happyCoding
Assuming you Apache configuration is already pointed to your public folder in your project folder as DocumentRoot, it should able to work by accessing this route:
localhost/alert
I noted you use localhost/laravel/alert which looks wrong because you set your route to be /alert not laravel/alert
If you are not sure this is Apache or Laravel issue, run php artisan serve on the project folder and access the routes with this address, localhost:8000/alert

Laravel TypiCMS redirects to root

I am using TypiCMS Laravel here : github.com/TypiCMS/Base and I am facing the following problem:
I created a new module named "News" by executing command: composer require typicms/news. I also added providers in config/app.php, have publish views and migrations and migrated the database too.
The only problem I am facing is that whenever the url I given, it redirects me to the root directory of my project, that is, http://localhost/mywebsite/public/
Even, if I give invalid route like localhost/mywebsite/public/foobar, instead of showing me error, it again redirects to the root directory.
I have checked the .htaccess and routes.php file and there is not modifications.
Regards:
Adnan
TypiCMS cannot be installed in a subfolder, the root of your site must be http://localhost.

Laravel 5.1 remove controller

I have simple question on Laravel 5.1. I have created a controller using php artisan command:
php artisan make:controller PageSettings
However it was mistake, because I really wanted to create this controller in Admin folder like this:
php artisan make:controller Admin/PageSettings
Now I want to get rid of my old PageSettings controller. Is it ok just to delete my old PageSettings.php manualy? Or there is something more what needs to be done?
If you only created it and found that you did it wrong, you can manually remove the file and that's it. However when you already added routes to this controller in routes.php you should remove them from routes.php file or alter the file to reflect your new controller.
It is OK to manually delete controller. Just check routes.php if you have some route to that controller and delete it also.
I had an issue with just deleting the file. I tried running my PHPUnit test suite and got an error that looked like this:
Warning: include(): Failed opening '/user/home/me/some/file.php' for inclusion (include_path='.:') in /usr/home/me/some/vendor/composer/ClassLoader.php on line 444
I had to run composer update then composer dump-autoload. After that, everything worked just fine.
Yeah, you can delete manually without tension.
I will suggest you for avoiding more mistakes, you "phpStrom" software, from using this, if you delete manually any file from by click right of mouse->Refactor->safe delete then before deleting they will give all places which were using your file. by clicking "do refactor" you can delete it.

Resources