Laravel Community Tools by Tighten

Tag "5.6" tricks

5 tricks
It's easy to notify one user by mail. But how to send a mail to all members of a Team? You can send one email to multiple recipients but it's not convenient, as it discloses recipient emails, which is not secure. Thus, you need to send bunch of personal emails on a loop. To do this create new TeamMailChannel and get MailChannel inside of it. Then iterate over users of a group and send emails. Your notification class should include TeamMailChannel inside via, however you should still use `toMail` method to prepare a message.
DavertMik 7 years ago 11175
5.6
Sometimes we need to validate that several fields that are partial percentages don't sum up over the 100%. It is possible to achieve this with a custom validation rule and then using it on each partial, indicating the other fields as arguments.
alariva 7 years ago 8615
5.6
This a simple way to use wilcard routing, for specific options.
neftaliyag... 7 years ago 3555
Had a need to copy files from Amazon S3 to my local system. This is the solution I ended up using. Working on Laravel 5.6
eric 8 years ago 18128
5.6
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 5283