Комментарии:
First commenter! Thankyou Povilas!
ОтветитьWeb.php can contain routes to "users". Bkw the {any?} will handle this case (together with the one with the post not found)?
ОтветитьIsn't it the purpose of the last registered route of an app ?
Route::fallback(function () { return //whatever you need; });
I use firstOrFail() and no need abort_if()
ОтветитьI went even further on this with my project a long time ago where it uses a "SlugController" and that processes this type of logic. That way it's more standard Laravel practice especially for looking up database items, but also to be more robust without bogging up the web.php route file
ОтветитьWhat is Route::feeds()?
ОтветитьHi Povilas, Is there any chance you can discuss about data residency and what is the best practice in Laravel? Basically laravel models that use different db connections in compliance with data protection and privacy regulations. How would you manage model relationships across multiple db connections? Thanks in advance. :)
ОтветитьI would use ->firstOrFail() and remove abort_if() statement
Ответитьreplace abort_if to firstOrFail()
ОтветитьPretty neat
ОтветитьHello! You say ”302 for SEO purposes” but I guess you mean ”301”, which is the correct status code for permanent redirection :)
Ответить