cybercog / laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.
https://komarev.com/sources/laravel-ban
MIT License
1.07k stars 63 forks source link

Middleware response field customization #46

Open antimech opened 5 years ago

antimech commented 5 years ago

It would be cool to be able to change login for Laravel's default email here: https://github.com/cybercog/laravel-ban/blob/8b78c2fc86a9a9e050a730149c9466025a673660/src/Http/Middleware/LogsOutBannedUser.php#L57

And here: https://github.com/cybercog/laravel-ban/blob/8b78c2fc86a9a9e050a730149c9466025a673660/src/Http/Middleware/ForbidBannedUser.php#L51

This way it would work out-of-the-box with Laravel.

Currently my workaround is middleware override.

antonkomarev commented 5 years ago

There are many middleware issues at this moment, because its pretty hard to make them generic for all of the projects. Personally I write my own implementations for them and using these middlewares as an examples. I like your idea, it will be good to have them work with default Laravel installation out of the box.

It's a breaking change and could be done only in next major release.

antimech commented 5 years ago

@antonkomarev thanks!