#Laravel 13 adds #[WithoutMiddleware] π
Attach middleware at the controller level, then opt out on specific actions.
Cleaner than managing multiple route groups
π New in #Laravel: Use `whenTableHasIndex()` and `whenTableDoesntHaveIndex()` to run logic based on whether your DB table already has an index. Perfect for safer migrations.
#Laravel Tip π
In Laravel 12, you can use the `toResource()` helper directly on your Eloquent models. Just fetch your data, and instantly convert it into a clean, structured API resource.
#Laravel Tip π
In Laravel, the `Arr::hasAll` method allows you to check if all the specified keys are present in an array. It supports nested keys using dot notation and returns true only if every key exists.
#Laravel Tip π
The `Str::mask` method hides part of a string by replacing it with a repeated character, making it useful for covering things like emails or phone numbers.
#Laravel Tip π₯
In Laravel, you can use the `whenNotExactly` method to execute a callback if a string is not an exact match, and you can add a second callback to execute if the string is an exact match.
#Laravel Tip π
if you only need a custom rule once, use a closure instead of a rule class. The closure gets the field name, its value, and a fail() callback for invalid data.