diff --git a/app/Http/Controllers/FormController.php b/app/Http/Controllers/FormController.php index ddbf059..eb4cce8 100644 --- a/app/Http/Controllers/FormController.php +++ b/app/Http/Controllers/FormController.php @@ -11,7 +11,12 @@ class FormController extends Controller public function index() { - return view('dashboard.administration.forms'); + + } + + public function showFormBuilder() + { + return view('dashboard.administration.formbuilder'); } public function saveForm(Request $request) @@ -54,11 +59,11 @@ class FormController extends Controller ] ); - $request->session()->flash('sucesss', 'Form created! You can now link this form to a vacancy.'); + $request->session()->flash('success', 'Form created! You can now link this form to a vacancy.'); return redirect()->back(); } - $request->session()->flash('errors', $validation->errors()); + $request->session()->flash('errors', $validation->errors()->getMessages()); return redirect()->back(); } diff --git a/config/adminlte.php b/config/adminlte.php index 071ead4..320b6ce 100644 --- a/config/adminlte.php +++ b/config/adminlte.php @@ -274,9 +274,20 @@ return [ 'url' => '/admin/positions' ], [ - 'text' => 'Manage Forms', + 'text' => 'Forms', 'icon' => 'fab fa-wpforms', - 'url' => '/admin/forms' + 'submenu' => [ + [ + 'text' => 'All forms', + 'icon' => 'far fa-list-alt', + 'url' => '/admin/forms' + ], + [ + 'text' => 'Form Builder', + 'icon' => 'fas fa-fw fa-hammer', + 'url' => '/admin/forms/builder' + ] + ] ] ] ], @@ -336,7 +347,7 @@ return [ 'plugins' => [ [ 'name' => 'Datatables', - 'active' => true, + 'active' => false, 'files' => [ [ 'type' => 'js', @@ -420,5 +431,21 @@ return [ ], ], ], + [ + 'name' => 'Toastr', + 'active' => true, + 'files' => [ + [ + 'type' => 'js', + 'asset' => false, + 'location' => 'https://cdn.jsdelivr.net/npm/toastr@2.1.4/toastr.min.js' + ], + [ + 'type' => 'css', + 'asset' => false, + 'location' => 'https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css' + ] + ] + ] ], ]; diff --git a/resources/views/dashboard/administration/forms.blade.php b/resources/views/dashboard/administration/formbuilder.blade.php similarity index 73% rename from resources/views/dashboard/administration/forms.blade.php rename to resources/views/dashboard/administration/formbuilder.blade.php index ad84a6c..d8b5158 100644 --- a/resources/views/dashboard/administration/forms.blade.php +++ b/resources/views/dashboard/administration/formbuilder.blade.php @@ -8,6 +8,28 @@ @stop +@section('js') + + @if (session()->has('success')) + + + + @elseif(session()->has('error')) + + @foreach(session('error') as $error) + + + + @endforeach + + @endif + +@stop + @section('content')