From 12496101e1aa7764e71187210016dc3b5107376c Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 22 Jul 2024 23:09:45 +1000 Subject: [PATCH] Rename back to leenooks/laravel, start to use components for html widgets, updated login form to include passkey --- composer.json | 2 +- resources/components/form/base.blade.php | 18 ++++++ resources/components/form/email.blade.php | 3 + resources/components/form/password.blade.php | 3 + resources/components/form/select.blade.php | 42 ++++++++++++++ resources/components/form/text.blade.php | 3 + resources/components/success.blade.php | 1 + .../adminlte/views/auth/login.blade.php | 31 ++++++++-- .../adminlte/views/layouts/auth.blade.php | 2 + .../views/widget/form_select.blade.php | 57 ------------------- .../adminlte/views/widget/form_text.blade.php | 17 ------ .../views/widget/success_button.blade.php | 1 - src/Providers/LeenooksServiceProvider.php | 12 ++-- 13 files changed, 108 insertions(+), 84 deletions(-) create mode 100644 resources/components/form/base.blade.php create mode 100644 resources/components/form/email.blade.php create mode 100644 resources/components/form/password.blade.php create mode 100644 resources/components/form/select.blade.php create mode 100644 resources/components/form/text.blade.php create mode 100644 resources/components/success.blade.php delete mode 100644 resources/themes/adminlte/views/widget/form_select.blade.php delete mode 100644 resources/themes/adminlte/views/widget/form_text.blade.php delete mode 100644 resources/themes/adminlte/views/widget/success_button.blade.php diff --git a/composer.json b/composer.json index 862f925..1f8db2a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "laravel/leenooks", + "name": "leenooks/laravel", "description": "Leenooks standard templates and tools.", "keywords": ["laravel","leenooks"], "license": "MIT", diff --git a/resources/components/form/base.blade.php b/resources/components/form/base.blade.php new file mode 100644 index 0000000..271be94 --- /dev/null +++ b/resources/components/form/base.blade.php @@ -0,0 +1,18 @@ +
+ @if(isset($label)) + + @endisset +
+ @isset($icon) +
+ +
+ @endisset() + {{ $slot }} + + @error($name) + {{ $message }} + @enderror + +
+
\ No newline at end of file diff --git a/resources/components/form/email.blade.php b/resources/components/form/email.blade.php new file mode 100644 index 0000000..5e0083a --- /dev/null +++ b/resources/components/form/email.blade.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/resources/components/form/password.blade.php b/resources/components/form/password.blade.php new file mode 100644 index 0000000..2fde082 --- /dev/null +++ b/resources/components/form/password.blade.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/resources/components/form/select.blade.php b/resources/components/form/select.blade.php new file mode 100644 index 0000000..5d4a79b --- /dev/null +++ b/resources/components/form/select.blade.php @@ -0,0 +1,42 @@ + + + + +@section('page-scripts') + @css(select2) + @js(select2,autofocus) + + +@append \ No newline at end of file diff --git a/resources/components/form/text.blade.php b/resources/components/form/text.blade.php new file mode 100644 index 0000000..7858650 --- /dev/null +++ b/resources/components/form/text.blade.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/resources/components/success.blade.php b/resources/components/success.blade.php new file mode 100644 index 0000000..6edb2db --- /dev/null +++ b/resources/components/success.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/themes/adminlte/views/auth/login.blade.php b/resources/themes/adminlte/views/auth/login.blade.php index 9494c9e..6e7c53e 100644 --- a/resources/themes/adminlte/views/auth/login.blade.php +++ b/resources/themes/adminlte/views/auth/login.blade.php @@ -76,11 +76,20 @@ -
- +
+
+ +
+
+ +
+
+ +
+
- + @@ -102,4 +111,18 @@ -@endsection \ No newline at end of file +@endsection + +@section('page-scripts') + + + + +@append \ No newline at end of file diff --git a/resources/themes/adminlte/views/layouts/auth.blade.php b/resources/themes/adminlte/views/layouts/auth.blade.php index c3bf5de..6357dcd 100644 --- a/resources/themes/adminlte/views/layouts/auth.blade.php +++ b/resources/themes/adminlte/views/layouts/auth.blade.php @@ -27,6 +27,8 @@ }) }) + + @yield('page-scripts') @show \ No newline at end of file diff --git a/resources/themes/adminlte/views/widget/form_select.blade.php b/resources/themes/adminlte/views/widget/form_select.blade.php deleted file mode 100644 index 688e50c..0000000 --- a/resources/themes/adminlte/views/widget/form_select.blade.php +++ /dev/null @@ -1,57 +0,0 @@ -
- -
- @empty($icon) - @else -
- -
- @endempty() - - - - - @error($id) - {{ $message }} - @enderror - -
-
- -@section('page-scripts') - @css(select2) - @js(select2,autofocus) - - -@append \ No newline at end of file diff --git a/resources/themes/adminlte/views/widget/form_text.blade.php b/resources/themes/adminlte/views/widget/form_text.blade.php deleted file mode 100644 index f45168c..0000000 --- a/resources/themes/adminlte/views/widget/form_text.blade.php +++ /dev/null @@ -1,17 +0,0 @@ -
- -
- @empty($icon) - @else -
- -
- @endempty() - - - @error($id) - {{ $message }} - @enderror - -
-
\ No newline at end of file diff --git a/resources/themes/adminlte/views/widget/success_button.blade.php b/resources/themes/adminlte/views/widget/success_button.blade.php deleted file mode 100644 index ef80179..0000000 --- a/resources/themes/adminlte/views/widget/success_button.blade.php +++ /dev/null @@ -1 +0,0 @@ -@if(session()->has('success')){{ session()->get('success') }}@endif \ No newline at end of file diff --git a/src/Providers/LeenooksServiceProvider.php b/src/Providers/LeenooksServiceProvider.php index 7bccb44..c1fbff6 100644 --- a/src/Providers/LeenooksServiceProvider.php +++ b/src/Providers/LeenooksServiceProvider.php @@ -2,8 +2,10 @@ namespace Leenooks\Providers; +use Illuminate\Support\Facades\Blade; use Leenooks\Http\Middleware\GuestUser; use Illuminate\Routing\Router; +use Illuminate\Support\Collection; use Illuminate\Support\ServiceProvider; /** @@ -13,7 +15,7 @@ use Illuminate\Support\ServiceProvider; */ class LeenooksServiceProvider extends ServiceProvider { - private $_path = ''; + private string $_path = ''; /** * Bootstrap the application services. @@ -31,10 +33,12 @@ class LeenooksServiceProvider extends ServiceProvider $this->loadViewsFrom($this->_path.'/resources/themes/metronic/views/', 'metronic'); - // Enable a Collect::recursive() function - \Illuminate\Support\Collection::macro('recursive', function () { - return $this->map(function ($value) { + //Blade::componentNamespace('Leenooks\\Components','leenooks'); + Blade::anonymousComponentPath($this->_path.'/resources/components', 'leenooks'); + // Enable a Collect::recursive() function + Collection::macro('recursive', function () { + return $this->map(function ($value) { if (is_array($value) || is_object($value)) { return collect($value)->recursive(); }