Category: Laravel

If you have a form separated into a few tabs with jQuery UI Tabs, then default Laravel validation will redirect you back to the first tab, even if the error was on the third tab.
Load Tabs with Active Tab VariableWherever you load your tabs in your JS code in Blade, add an option and a Laravel variable:$( "#tabs" ).tabs({ active: {{ $active_tab ??
'0' }} });If the variable is not set, it will default to first tab (indexed as 0), so pretty safe to add this code snippet.
Setting Active Tab in create() MethodNow, we need to set this variable somehow, right?
All errors are actually saved in Laravel session, so to get them we can just do session(‘errors’).
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Community Partners