This Laravel package is designed to make creating secure URLs with a limited lifetime easy. The accompanying blog post also includes more back story on why it was created. Basically to use in emails for generating unique unsubscribe links. This prevents an easily guessable URL like site.com/user/1/unsubscribe
.
02 May, 2021
Laravel Mandrill Webhook Controller
Programing Coderfunda May 02, 2021 Packages, php No comments
Laravel Mandrillhooks is a package that includes a simple Mandrill webhook base controller for catching bounced, rejected, etc mail events:
A simple Mandrill webhook controller to help with email events. Useful for notifying users that you cannot reach them via email inside your application. Compatible with Laravel 5+ and Lumen 5+.
After installing, you can setup your controller that extends MandrillWebhookController
and then add methods that follow a specific format to match Mandrills hooks. In the code this is:
'handle' . studly_case(str_replace('.', '_', $event['event']));
I was unable to find a list of webhooks from Mandrills side so it would be nice if the readme included a full list of web hooks or at least linked to a list.
Laravel SearchIndex package now supports Algolia
Programing Coderfunda May 02, 2021 Packages, php No comments
Freek Van der Herten has updated his search index Laravel package to now support the Algolia search API.
Earlier this year I made a package to easily work with a searchindex in Laravel. Basically, it provides:
* an interface that makes your objects searchable
* some easy to use functions to put those objects into the search index
* a function to retrieve search results from the indexThe only supported index was Elasticsearch. I’ve now added support for Algolia to that package. It makes working with Algolia a cinch.
Useful Laravel Validation Rule Packages
Programing Coderfunda May 02, 2021 Packages, php No comments
Laravel Validation Rules is a GitHub organization containing a collection of useful validation rules that you can pull into any project quickly and not have to write them yourself. At the time of writing here’s the list of validation rule packages:
- Colour (currently supports hex)
- Country Codes
- Credit Card
- IP
- Phone
- Subdomain
- Timezone
- US States and CA Provinces
Here’s an example from the documentation using the US states validation package:
use LVR\State\Abbr;
use LVR\State\Full;
# Abbreviation vs Full
$request->validate(['test' => 'UT'], ['test' => new Abbr]); // Pass!
$request->validate(['test' => 'BC'], ['test' => new Abbr); // Pass!
$request->validate(['test' => 'Utah'], ['test' => new Full]); // Pass!
$request->validate(['test' => 'Alberta'], ['test' => new Full]); // Pass!
# Abbreviation - USA vs Canada
$request->validate(['test' => 'UT'], ['test' => new Abbr]); // Pass!
$request->validate(['test' => 'UT'], ['test' => new Abbr('US')]); // Pass!
$request->validate(['test' => 'BC'], ['test' => new Abbr('CA')); // Pass!
# Full - USA vs Canada
$request->validate(['test' => 'Utah'], ['test' => new Full('US')]); // Pass!
$request->validate(['test' => 'Alberta'], ['test' => new Full('CA')]); // Pass!
To learn more about this project, check out the Laravel Validation Rules documentation. You can view the source code of the various validators by browsing repositories in the GitHub organization.