laravel slow to render pages issue - php

I'm booting up a development server for my laravel project with:
php artisan serve --port=3030
The issue is that the response time is way too long (~17 seconds). Chrome dev tools are saying the routing to the index method is the issue but, I'm only attempting to retrieve a basic view.
Does anyone have any advice? This is an issue on all my laravel projects on my work machine.
Appreciate any response,
Sam

Related

Why can't PHP flock on btrfs filesystem?

I am trying to set up a chromebook for Laravel development and I was having trouble with my project throwing "419 Page Expired" on every form. The project works fine on a Manjaro development machine.
I traced the issue down to Laravel's file-system session driver not retrieving the session token from the file system.
It seems that Crostini (ChromeBook Linux Container) uses a btrfs root filesystem and any attempt to use php's "flock" function always results in a failure response.
Has anyone come across this before? Does anyone have any idea of a possible work-around? I would imagine, with the abundance of containerised development environments, that this is a common problem, but I have googled to no avail.

How to fix bizarre incorrect Laravel routing?

I am building a simple website in Laravel 6. I used the built in Laravel artisan tools to create authentication routes and views.
After logging in, a user should be redirected to /home. However, every now and then Laravel will redirect to /js/popper.js.map
I have no idea why Laravel is doing this! I have scoured error logs, to no avail. I am using Bootstrap, but I never explicitly told Laravel to import or use Popper. I have no idea why it specifically wants to go this specific file?? I've had this problem for weeks.
Sometimes running php artisan config:cache and cache:clear help, but not always. Furthermore, it sometimes will happen on my remote server, or on local, but often not at the same time, making it very hard to debug.
I have declared the Auth routes with the built in Laravel Auth. Like so:
php artisan ui bootstrap
And in web.php:
Auth::routes();
I expect logging in to redirect to /home, which then redirects to welcome/red (part of my software). Instead, it gets stuck at js/popper.js.mapand 404s. Logging in WORKS, and I can access authenticated content. But it's a bad user experience to get stuck in a 404 page for no reason.
Does anyone have any clue where Laravel is getting the idea to redirect to /js/popper.js.map? Thank you!!!!
I’ve never had this issue. Maybe you could start with a simple controller and view? Without any assets and packages loaded? From that point add packages and assets one by one. You should find your bug. And did you write any tests? That should help a lot!
And I assume this popper.js file is loaded by a npm package? Maybe it helps to uninstall it?

PHP Laravel: Any sort of package or way to active live log while doing php artisan serve

I've been working in ruby/rails for a while now and just recently switched up to PHP Laravel for my new work position.
In rails, when I would run my server it would show me very useful things such as: which route is getting hit, what queries ran for that controller and so on.
On Laravel when when I run a server all it says
Laravel development server started: <http://127.0.0.1:8000>
and it just sits there.
Is there some composer package or something I don't know about that I have to switch on in the config to show some kind of relevant information while routes are being hit???
I've been googling up 'laravel live log' and stumbled across this package
https://packagist.org/packages/mic/log-like-rails
But I can't seem to install it correctly.
Laravel Framework 5.6.22
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1

Laravel app downloading all assets again on every route request

I have a strange error in my Laravel(5.6)/app. Whenever there is any route request in the app, all css, js, bootstrap and icons files reload all over again in the browser. I'm debugging this app from last 2 days. And I have no clue what's going on.
I worked on this project a few days ago and it was working fine then I started working on some other project and after a couple of days when I worked again on this project to add some new features, it is behaving like this. Whenever I request any route in the app, all the assets download and load again in the browser. I didn't provide any code sample here because I don't know where the error might be.
If there have been an error in some particular file then that particular route would have behave that way. But all routes reload all the assets all over again. So I just want your opinion is this ever happens to you and how should I tackle it?
If you wanna recreate this project then here is the GitHub link. Git Repo . Recreating this project is very easy. Just create a database. run migrations and then seed the database. For sass and js ,run 'npm run dev' if needed.
Update: Solution to this problem is, don't use buit-in server of laravel, it sucks. Use any php development stack like xampp, wamp etc. and it will work fine.

Laravel 4 - Local to Staging 404 issue

I hope that this isn't too broad a question but I have been developing a site locally for a month or so and am ready to put it up on my staging server. The deployment all went smoothly after a little issue installing Mcrypt but all is good now, except for in my staging environment I get a 404 on every route.
They way my application is structured is I have folder in app that contains each of my modules, each module (Users, Auth, Teams etc.) each have their own routes.php file aswell as controllers/models/repositories etc.
If I access the site using say /login I recieve a 404, however, If i was to quickly create that route in the main routes.php file in app/ it works which is leading me to believe that for some reason the server isn't loading the individual modules files.
Can you give me a hand narrowing it down, what sort things should I look at etc?
Thanks in advance.
Ok so I found out the issue.
For some reason my local (homestead) environment wasn't too bothered about case sensitivity, however, my staging server was. A few tweaks and I am up and running, cheers for the ideas though :)

Categories