Laravel Community Tools by Tighten

lcdss

Joined: 10 years ago
Total tricks: 2
Last trick: 8 years ago

Submitted tricks

When you have a model with unique value column and tries seeder your table using a big amout, sometimes the QueryException is thrown, because Faker doesn't know what values was previously generated and the number of combinations is limited.
lcdss 10 years ago 16056
First you create a file called Cors.php in app/Http/Middleware, then you register the middleware in the app/Http/Kernel.php file. If you want, you can change the default values adding the keys CORS_ALLOW_METHODS, CORS_ALLOW_ORIGINS, CORS_ALLOW_HEADERS and CORS_MAX_AGE to your .env file. Simple as that! This class is based on spatie/laravel-cors package.
lcdss 8 years ago 5296