From 4f34db33813b4ccc27095726c892f6da9ef91857 Mon Sep 17 00:00:00 2001 From: Ranjan Date: Sun, 7 Apr 2024 13:43:06 +0545 Subject: [PATCH] spatie form packages --- .../Http/Controllers/EmployeeController.php | 4 +- .../Employee/resources/views/create.blade.php | 26 ++ .../Employee/resources/views/index.blade.php | 12 +- .../resources/views/partials/action.blade.php | 279 ++++++++++++++++++ composer.json | 1 + composer.lock | 80 ++++- config/app.php | 25 +- 7 files changed, 403 insertions(+), 24 deletions(-) create mode 100644 Modules/Employee/resources/views/create.blade.php create mode 100644 Modules/Employee/resources/views/partials/action.blade.php diff --git a/Modules/Employee/app/Http/Controllers/EmployeeController.php b/Modules/Employee/app/Http/Controllers/EmployeeController.php index cf8691d..b911669 100644 --- a/Modules/Employee/app/Http/Controllers/EmployeeController.php +++ b/Modules/Employee/app/Http/Controllers/EmployeeController.php @@ -5,7 +5,6 @@ namespace Modules\Employee\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; -use Illuminate\Http\Response; class EmployeeController extends Controller { @@ -22,7 +21,8 @@ class EmployeeController extends Controller */ public function create() { - return view('employee::create'); + $data['title'] = 'Create Employee'; + return view('employee::create', $data); } /** diff --git a/Modules/Employee/resources/views/create.blade.php b/Modules/Employee/resources/views/create.blade.php new file mode 100644 index 0000000..f57f6e4 --- /dev/null +++ b/Modules/Employee/resources/views/create.blade.php @@ -0,0 +1,26 @@ +@extends('layouts.app') + +@section('content') +
+
+ + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+ @csrf + @include('employee::partials.action') +
+ + + + +
+ +
+@endsection + +@push('js') + +@endpush diff --git a/Modules/Employee/resources/views/index.blade.php b/Modules/Employee/resources/views/index.blade.php index d4ef68a..8f755f4 100644 --- a/Modules/Employee/resources/views/index.blade.php +++ b/Modules/Employee/resources/views/index.blade.php @@ -14,8 +14,7 @@
@@ -23,8 +22,8 @@
- + Create Employee
@@ -221,13 +220,8 @@
- - - - - diff --git a/Modules/Employee/resources/views/partials/action.blade.php b/Modules/Employee/resources/views/partials/action.blade.php new file mode 100644 index 0000000..7c316c4 --- /dev/null +++ b/Modules/Employee/resources/views/partials/action.blade.php @@ -0,0 +1,279 @@ +
+
+
+
+

Personal Details

+
+ +
+ +
+ {{ html()->label('First name')->class('form-label') }} + {{ html()->text('first_name')->class('form-control')->placeholder('Enter First Name')->required() }} +
+ +
+ {{ html()->label('Middle name')->class('form-label') }} + {{ html()->text('middle_name')->class('form-control')->placeholder('Enter Middle Name') }} +
+ +
+ + +
+ +
+ + +
+ + + + +
+ +
+ + +
+
+
Attached files
+
+
+
+

Add Attached files here.

+ +
+ +
+
+ +
+ +
Drop files here or click to upload.
+
+
+ +
    + +
+ +
+
+
+ +
+ + + +
+
+ +
+
+
+
Privacy
+
+
+
+ + +
+
+ +
+ + +
+
+
Tags
+
+
+
+ + +
+ +
+ + +
+
+ +
+ + +
+
+
Members
+
+
+
+ + +
+ + +
+ +
+ +
+ +
diff --git a/composer.json b/composer.json index 12ecf9e..c04f260 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "laravel/tinker": "^2.8", "laravel/ui": "^4.5", "nwidart/laravel-modules": "^11.0", + "spatie/laravel-html": "^3.7", "spatie/laravel-permission": "^6.4", "yoeunes/toastr": "^2.3" }, diff --git a/composer.lock b/composer.lock index 06c4f77..5c67dcf 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8382101c555e42e8fbbf188fa8b7b1c6", + "content-hash": "6dc3e011b2ee18ecf5f0987aba384f2b", "packages": [ { "name": "barryvdh/laravel-debugbar", @@ -3675,6 +3675,84 @@ ], "time": "2023-11-08T05:53:05+00:00" }, + { + "name": "spatie/laravel-html", + "version": "3.7.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-html.git", + "reference": "df15763c190954ee46a74e0bf5b4b5bbf2e1f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-html/zipball/df15763c190954ee46a74e0bf5b4b5bbf2e1f170", + "reference": "df15763c190954ee46a74e0bf5b4b5bbf2e1f170", + "shasum": "" + }, + "require": { + "illuminate/http": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "php": "^8.2" + }, + "require-dev": { + "mockery/mockery": "^1.3", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.34" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\Html\\HtmlServiceProvider" + ], + "aliases": { + "Html": "Spatie\\Html\\Facades\\Html" + } + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\Html\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A fluent html builder", + "homepage": "https://github.com/spatie/laravel-html", + "keywords": [ + "html", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/laravel-html/tree/3.7.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2024-03-23T11:28:29+00:00" + }, { "name": "spatie/laravel-permission", "version": "6.4.0", diff --git a/config/app.php b/config/app.php index bca112f..7f49204 100644 --- a/config/app.php +++ b/config/app.php @@ -13,7 +13,7 @@ return [ | framework needs to place the application's name in a notification or | any other location as required by the application or its packages. | - */ + */ 'name' => env('APP_NAME', 'Laravel'), @@ -26,7 +26,7 @@ return [ | running in. This may determine how you prefer to configure various | services the application utilizes. Set this in your ".env" file. | - */ + */ 'env' => env('APP_ENV', 'production'), @@ -39,7 +39,7 @@ return [ | stack traces will be shown on every error that occurs within your | application. If disabled, a simple generic error page is shown. | - */ + */ 'debug' => (bool) env('APP_DEBUG', false), @@ -52,7 +52,7 @@ return [ | the Artisan command line tool. You should set this to the root of | your application so that it is used when running Artisan tasks. | - */ + */ 'url' => env('APP_URL', 'http://localhost'), @@ -67,7 +67,7 @@ return [ | will be used by the PHP date and date-time functions. We have gone | ahead and set this to a sensible default for you out of the box. | - */ + */ 'timezone' => 'UTC', @@ -80,7 +80,7 @@ return [ | by the translation service provider. You are free to set this value | to any of the locales which will be supported by the application. | - */ + */ 'locale' => 'en', @@ -93,7 +93,7 @@ return [ | is not available. You may change the value to correspond to any of | the language folders that are provided through your application. | - */ + */ 'fallback_locale' => 'en', @@ -106,7 +106,7 @@ return [ | data for your database seeds. For example, this will be used to get | localized telephone numbers, street address information and more. | - */ + */ 'faker_locale' => 'en_US', @@ -119,7 +119,7 @@ return [ | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | - */ + */ 'key' => env('APP_KEY'), @@ -136,7 +136,7 @@ return [ | | Supported drivers: "file", "cache" | - */ + */ 'maintenance' => [ 'driver' => 'file', @@ -152,7 +152,7 @@ return [ | request to your application. Feel free to add your own services to | this array to grant expanded functionality to your applications. | - */ + */ 'providers' => [ @@ -194,6 +194,7 @@ return [ // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, + Spatie\Html\HtmlServiceProvider::class, ], @@ -206,7 +207,7 @@ return [ | is started. However, feel free to register as many as you wish as | the aliases are "lazy" loaded so they don't hinder performance. | - */ + */ 'aliases' => Facade::defaultAliases()->merge([ // 'ExampleClass' => App\Example\ExampleClass::class,