Laravel/PHP Articles

Articles from Laravel/PHP sites on the web

Laravel/PHP Articles
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’).

Sign Up For Our Newsletter

Each Week, We curate the top Laravel/PHP articles, jobs, events and More!

We'll send you a weekly email with the latest Laravel/PHP articles, jobs and events. Please review our Code of Conduct in the meantime. Talk to you soon!