Skip to content

Tag: laravel-5.4

Laravel 5.4 environment based config files

I am trying to change the Laravel configuration variables based on environment, but I do not know how. Code to get config is I am trying to have a separate results for the live environment and the development environment. Real life scenario I need to override some config files, so everybody who is using the d…

Redirect to route in laravel not working

I am working on Laravel 5.4.36 application where my route label is defined in web.php as, but when I am trying to redirect from a control function to a route label using, Error: InvalidArgumentException Route [label] not defined. or Error: FatalErrorException Class ‘AppHttpControllersRedirect’ not…

localization FakerFactory does not work in laravel

I have a Post Model with these fields : Now I want to use laravel sedders and model factories to create fake fa_IR localized data and insert to posts table. For that I wrote this in database/factories/ModelFactory.php: Then I created a PostsTableSeeder class like this : And in AppServiceProvider.php added bel…

Convert to Laravel exception?

Currently in a package, it has HttpException exception Is there a way to to convert it Laravel HttpResponseException uses without touching that exception from the package? Answer You can catch that exception and rethrow it. In your app/Exceptions/Handler.php file. Edit: I haven’t tested this but accordi…