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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners