Hesitate to remove utility in my laravel 5.5 project - laravel-5

How about, some time ago I had installed this utility to monitor the query results in my application, now I want to remove it, but I do not know how, someone knows how I can deactivate it?

Welcome to StackOverflow!
That bar at the bottom is called the Laravel Debugbar which is found here: https://github.com/barryvdh/laravel-debugbar
It is controlled by a setting in your .env file in the root of your project called APP_DEBUG. Set this to false to hide the bar (recommended for production).
To uninstall it from your project completely, run composer remove barryvdh/laravel-debugbar. Depending on your Laravel version, you may also have to remove the Service Provider from config/app.php (under providers) or remove it from app/Providers/AppServiceProvider.php depending how you originally installed it.
Note: If you're caching your config (by using php artisan config:cache) then don't forget to clear your config cache after changes by running php artisan config:clear.

Related

Laravel's ui:auth command generating incompatible Controllers

I have a Laravel installation on v7.29.3 (our server won't support v8 yet)
I am having an issue with the ui:auth command. It is generating Controllers that reference classes in the Illuminate namespace that don't exist.
For example, the Auth\VerificationController class it gives me, uses Illuminate\Foundation\Auth\VerifiesEmails but I can't see a corresponding file in the /vendor/laravel/src/Illuminate/Foundation/Auth directory.
What's more, when I search for "VerifiesEmails" in the Laravel API doc for v7.x there is no such file. This file does exist however when I search for it in v6.x
So my guess is that I've got a mismatch somewhere and I'm getting v6 controllers for a v7 installation.
However, composer is showing that I have laravel/ui 2.5 which is supposed to be for Laravel 7.
I've tried deleting my composer.lock and vendor directories and reinstalling from composer in the hope that would clear up the issue, but no dice.
Any ideas what could be going on?
Those classes aren't in vendor/laravel/framework/src/.... They are not part of the framework. They come from the laravel/ui package, vendor/laravel/ui/auth-backend/....

File session driver not working properly on production (Laravel on shared hosting)

When using session on my local environment all worked ok, but when I publish the site in a shared hosting I started noticing some strange behaviours in the app. After a while I realized it has to do with the session and specifically I noticed that when I was working on my local environment the storage/framework/sessions folder only had 1 file that keep updating on any change but then on production I start monitoring the same folder and I realized that on any change instead of updating the file (or creating a new one and deleting the other) it was creating a new file but also keeping the old files making the app start acting in a wrong way.
Is this normal or should it be only 1 file per session as it was in the local environment?
Update
After login the user the app ask to select the business they want to work and also they can change between business after, to store the business they choose I use the session and there is where the problem pop, after every change on that property of the session it creates a new session file without deleting the old one. Again when I do exactly the same thing locally it works but for some reason on the shared hosting it doesn't.
SOLUTION
After days of trying to figure it out, I just figure out the solution.
Instead of using the Global Helpers of Laravel for storing the data I did it throw the request and apparently that work it out.
So basically instead of doing this:
session('clienteElegido' => $client);
I change it for this:
$request->session()->put('clienteElegido',$client);
I still don't understand what's the difference and why it was working fine in my local environment and not in the share host but its working now like that so all good.
Thank you for all the quick replies.
Try clearning cache, route, config and view
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
and let's see if your session issue will be fixed.

Clean Laravel To Bake New Project

I just did a fresh install of Laravel v5.5.25. I want to create a brand new project so I want to clear out some files in Laravel. For example, I want to delete all readymade templates (welcome page too), delete bootstrap from Laravel, etc. I just want to do ultimate start. So, will you please guide me what else should I delete too to make it a skeleton? And please tell me how can I remove bootstrap completely and replace it with Bulma.
You can run:
php artisan preset none
to remove default preset.
There is no Bulma preset of of the box, available options are:
none
bootstrap
vue
react
You can use Laravel Presets for that. If you want a “skeleton” as you said you should use php artisan preset none. There is also one for Bulma: composer require laravel-frontend-presets/bulma and then php artisan preset bulma.

Laravel Blade views not showing the changes made to them

System Details : Using WAMP2.5 in Windows 64 bit MYSQL:5.6.17 PHP:5.5.12 Apache :2.4.9I installed laravel via composer installation . It was all fine since recently all my views stopped showing any changes made to them . This is happening to views which use Blade template only.
I have created the blade files correctly and named them with filename.blade.php.
My view File Structure -
views
-layouts
defaults.blade.php
show.blade.php
login.blade.php
defaults.blade.php
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<nav></nav>
#yield('content')
</div>
#yield('footerscripts')
</body>
</html>
show.blade.php
#extends('layouts.defaults')
#section('content')
--- SOME CONTENT ---
#stop
#section('footerscripts')
--- js scripts ---
#stop
The same format was working perfectly but suddenly started acting strangely.Even after refreshing many times the view doesn't change,Once i tried deleting everything inside the view page still it showed up in the browser.
There are similar question but many didn't have accepted answer and the one with some ratings didn't worked for me . I also tried re-installing fresh new WAMP copy but no Help.It only works if i change its name but if i change it back to the original one it again starts showing the old version of it.
Only happens with blade templating.
If you use PhpStorm:
open menu File → Settings
go to Deployment → Options section
then uncheck Preserve files timestamps option
I'm not sure of the specifics, but this is related to how filemtime() is implemented in windows (possibly related bug here).
Illuminate\View\Compilers\BladeCompiler (well, it's parent class, Compiler) checks to see if a file has changed since last compilation by checking it's mtime, through Illuminate\Filesystem\Filesystem which calls calls filemtime() (see L179-188). Evidently this is failing to report properly on your system.
First, ensure that the app/storage/views directory has read, write and delete permissions. If this doesn't help, the simplest solution would be to clear the app/storage/views/ directory whenever making a change.
I had this same issue , reason was I am doing uploads remote, but the time on my computer was different than what that was on my server
I got very easy solution, I was having same project in two folders, I was editing one and php artisan was running on other, when get to that project where php server was running in it and made changes it worked.
In your cmd(command prompt) or terminal type and press enter...
php artisan view:clear
For this to work, your terminal should be pointed to your root directory of your laravel installation/folder
Or delete files in the folder
storage/framework/views
In order to avoid the parsing of Blade files on each reload, Laravel is designed to caches views after Blade is parsed, to avoid re-parsing the blades on each reload.
Or make sure you are editing the right view, in the right Laravel Installation.
Run the command npm run production or npm run dev
It solved my problem:
I had the same issue except my controller methods also did not want to reflect changes along with views. I tried the following commands:
user:/var/www/html/website$ php artisan cache:clear
Application cache cleared!
user:/var/www/html/website$ php artisan config:clear
Configuration cache cleared!
user:/var/www/html/website$ php artisan route:clear
Route cache cleared!
user:/var/www/html/website$ php artisan view:clear
Compiled views cleared!
Nothing changed.
I echoed an incorrect variable from a controller method. Nada!
I changed the app.css?v=2 file version. In the silence that followed after... there was no difference.
I cleared my browser cache.
I manually deleted:
bootstrap/cache/config.php
framework/sessions/*
framework/views/*
No changes and finally I ran the command npm run production and bingo! Try it, it will save you 2 and a half hours of frustration and radical thoughts.
Laravel/framework v5.6
Clear cache and restart php-fpm. That solved it for me.

Symfony2 dev environment not clearing cache automatically

I'm working on a new Symfony2 project, and I'm using the app_dev frontcontroller to view the default AcmeDemoBundle's pages.
When I make changes to the controllers, I get an exception (NotFoundHttpException: No route found for "GET /demo/hello/World"). If I clear the cache using php app/console cache:clear, things work great again. However, it is my understanding that by using the app_dev front controller, I shouldn't be required to do this. Am I doing something wrong?
Soms system specs:
OSX Lion using MAMP
PHP 5.3.6
Symfony 2.0.1
Are you using different users for webserver and command line user? Maybe you should check for permissions in the Setting up Permissions paragraph.

Resources