Skip to content

Tag: laravel

Laravel use Request validation with api

I’m trying to implement validation in my api like this: RideUpdateRequest: So how could I give a error message back in json (if the request validation fails)? Right now in postman I receive nothing back? –EDIT– response: Could I get something like this?: Answer If you take a look at the Form…

How to set laravel 5.3 logout redirect path?

Is there no elegant solution to redirect to a specific page after logging out in Laravel 5.3? The function being called is from the trait AuthenticatesUsers: This is a default function from the core of laravel. So I have to override the whole function I cannot edit the core. But isn’t there a more simpl…

Laravel – custom .env file

Laravel assumes that .env file should describe environment, and it should not be committed to your repo. What if I want to keep both .env files for dev and production (say .env-production and .env-…

Run only one unit test from a test suite in laravel

Using phpunit command Laravel will run all unit tests in our project. How to run one or specific Unit Tests in Laravel 5.1? I just want to run testFindToken from my test suite. Answer Use this command to run a specific test from your test suite. If you want to be more specific about your file then pass the fi…

Laravel str_slug not working for unicode bangla

I am working in a laravel project. I have slugged url. Its working fine for English language. But while I use Bangla it returns empty. Please help me to solve the issue. Answer str_slug or facade version Str::slug doesn’t work with non-ascii string. You can instead use this approach