Change root folder name - laravel

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

Related

Laravel pdf issue: failed to open stream: No such file or directory by using barryvdh/laravel-dompdf package

I am update composer and use barryvdh/laravel-dompdf package.
the problem is when i click the button it show me error like image below:-
Is that anyway to change the folder path? or am I missing code to modify path to download the pdf file?
You need to run this command:
php artisan vendor:publish
Then, try to create a fonts directory in the storage directory.
i.e. storage/app/fonts. Also, remember to make it writable.
For maximum execution time of 30 seconds exceeded, this is not laravel related issue but it's about php configuration issue. Please see this and fix it: http://php.net/manual/en/info.configuration.php#ini.max-execution-time
You can also see this answer: https://stackoverflow.com/a/30290770/6000629
Hope this will helps you!
Try this:
$pdf = PDF::loadView('pdf/personalpdf', compact('user','result'))->setOptions(['defaultFont' => 'sans-serif']);
It worked for me, I didn't make any file/folder
Just remove the reference to css external file in your cart.placeOrder.blade
Note: This directory must exist and be writable by the webserver process.
under the config file thats what it say: therefore you should create the fonts directory inside the storage.
"font_cache" => storage_path('fonts/'),

View [layouts.app] not found in laravel

I have created an application in laravel using appzcoder crud-generator plug-in. i have done everything accordingly but i am getting the above mentioned error. I have a folder named layouts in views folder and this folder has app.stub in it. but when i run the project it gives the following error
View [layouts.app] not found. (View:C:\wamp64\www\myProject\resources\views\admin\items\index.blade.php)
make sure you have run below code if not run it will create layout.app path
or manually create view/layout/app.php
php artisan vendor:publish --provider="Appzcoder\CrudGenerator\CrudGeneratorServiceProvider"

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 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.

Artisan packages error

I'm having some trouble with artisan/packages.. I've added a package to my composer file and ran composer update and an error was returned:
PHP Warning: require(/home/xxx/public_html/bootstrap/autoload.php): failed to open stream: No such file or directory in /home/xxx/public_html/artisan on line 16
I can see that require path is incorrect, my structure is like so:
/home/xxx/bootstrap
/home/xxx/app
/home/xxx/vendor
/home/xxx/public_html
I hadn't changed any of the paths and everything seemed to work out of the box with this structure, basically removing the public folder and pushing everything up a directory.
I've opened up Artisan tried a couple of paths that kept failing so i've changed them to absolute:
require '/home/xxx/bootstrap/autoload.php';
It seemed to work from here on, but at the end of the process got another error:
Writing lock file
Generating autoload files
[RuntimeException]
Could not scan for classes inside "app/commands" which does not appear to be a file n or a folder
Rather than continue to mess it up i thought now would be a good time to clear it up, any ideas how to fix this?
Make sure you are using php 5.3 or higher.
Run php -v
Try creating an empty "app/commands" folder, fixed the issue for me!

Resources