Menu and Tab Utils
A Laravel library to to build menus and tabs navigation utilities, based on Boostrap 5 CSS Framework. Current version: 2.2.0. Project on GitHub. Project on Packagist. This demosite sources available here.
Tabs with editor
Here we build tabs included in a form. Each tab contains two fields that are all sent to form processing, as you can see by clicking "send" button. Be sure to set different tag ids and tag names in your tabs; here we use array parameters to different values for each language. In your controller, define a variable this way and pass variable to the view parameters:
$element = TabUtils::init('editors', // main tab id
[
'current' => 'english', // sets current ative element
'tabs' => [ // sets tabs elements
'english' => [ // array key is the tab element's id. Be sure to define an id not used elsewhere in doc
'title' => 'English', // label of tab element
'view' => 'tabs.editors', // path of blade template
'viewparams' => [ // parameters to be passed to view
'titleid' => 'title-english', // title field id
'titlefield' => 'title[english]', // title field name
'titleval' => 'English Title', // title field content
'editorid' => 'text-english', // editor id
'editorfield' => 'text[english]', // editor textarea name
'editorval' => '... html code', // content inited in editor
],
],
...
]
]);
return view('template', ['element' => $element]);
Then just insert the variable in the appropriate section in your view: {!! $element !!}