From 82353c1ecd538f44a33563196e7d91f73861378e Mon Sep 17 00:00:00 2001 From: Charles T Date: Tue, 25 Jul 2023 22:18:01 +0800 Subject: [PATCH] Update (all): fix php formatting using laravel pint, fix blade using shufo --- app/Helpers/Global/geo_helper.php | 2 +- app/Helpers/Global/helpers.php | 3 +- app/Helpers/Global/string_helper.php | 1 - .../Controllers/Admin/DashboardController.php | 3 - .../Controllers/Admin/ProfileController.php | 3 +- app/Http/Controllers/Admin/UserController.php | 1 - .../Controllers/Auth/RegisterController.php | 4 +- app/Http/Controllers/Front/HomeController.php | 21 ++- app/Http/Requests/ProfileUpdateRequest.php | 6 +- app/Models/Category.php | 56 ++++---- app/Models/CountryLocale.php | 27 ++-- composer.json | 2 +- composer.lock | 2 +- config/models.php | 30 ++--- config/platform/general.php | 8 +- config/seotools.php | 44 +++---- ...3_07_24_154301_create_categories_table.php | 3 +- resources/views/admin/home.blade.php | 5 +- resources/views/admin/users/index.blade.php | 24 ++-- resources/views/auth/login.blade.php | 24 ++-- .../views/auth/passwords/confirm.blade.php | 12 +- .../views/auth/passwords/email.blade.php | 25 ++-- .../views/auth/passwords/reset.blade.php | 24 ++-- resources/views/auth/profile.blade.php | 58 +++++---- resources/views/auth/register.blade.php | 28 ++-- resources/views/auth/verify.blade.php | 2 +- resources/views/front/country.blade.php | 123 +++++++++--------- resources/views/layouts/admin/app.blade.php | 18 +-- .../views/layouts/admin/footer.blade.php | 46 +++---- resources/views/layouts/admin/guest.blade.php | 3 + .../views/layouts/admin/header.blade.php | 63 ++++----- .../views/layouts/admin/navigation.blade.php | 119 ++++++++++------- resources/views/layouts/front/app.blade.php | 2 + .../views/layouts/front/footer.blade.php | 122 +++++++++-------- .../views/layouts/front/header.blade.php | 1 + .../views/layouts/front/navigation.blade.php | 99 +++++++------- routes/web.php | 2 - 37 files changed, 536 insertions(+), 480 deletions(-) diff --git a/app/Helpers/Global/geo_helper.php b/app/Helpers/Global/geo_helper.php index e78c716..b26f4fb 100644 --- a/app/Helpers/Global/geo_helper.php +++ b/app/Helpers/Global/geo_helper.php @@ -43,4 +43,4 @@ function get_current_ip() return $ip_add_set[0]; } -} \ No newline at end of file +} diff --git a/app/Helpers/Global/helpers.php b/app/Helpers/Global/helpers.php index 7c9fe86..2fb05db 100644 --- a/app/Helpers/Global/helpers.php +++ b/app/Helpers/Global/helpers.php @@ -1,5 +1,4 @@ route('home.country', ['country' => 'my']); + return redirect()->route('home.country', ['country' => 'my']); } public function country(Request $request, $country) { - $country = CountryLocale::where('slug', $country)->first(); + $country = CountryLocale::where('slug', $country)->first(); - if (!is_null($country)) - { - $categories = Category::where('country_locale_id', $country->id)->get(); + if (! is_null($country)) { + $categories = Category::where('country_locale_id', $country->id)->get(); - return view('front.country', ['categories' => $categories, 'country' => $country]); - } + return view('front.country', ['categories' => $categories, 'country' => $country]); + } - return redirect()->route('home.country', ['country' => 'my']); + return redirect()->route('home.country', ['country' => 'my']); } } diff --git a/app/Http/Requests/ProfileUpdateRequest.php b/app/Http/Requests/ProfileUpdateRequest.php index 52a7583..ec2dc83 100644 --- a/app/Http/Requests/ProfileUpdateRequest.php +++ b/app/Http/Requests/ProfileUpdateRequest.php @@ -2,9 +2,9 @@ namespace App\Http\Requests; -use Illuminate\Validation\Rule; -use Illuminate\Support\Facades\Auth; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Support\Facades\Auth; +use Illuminate\Validation\Rule; class ProfileUpdateRequest extends FormRequest { @@ -28,4 +28,4 @@ protected function prepareForValidation() $this->request->remove('password'); } } -} \ No newline at end of file +} diff --git a/app/Models/Category.php b/app/Models/Category.php index ccb145b..3202dc6 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -12,7 +12,7 @@ /** * Class Category - * + * * @property int $id * @property int $country_locale_id * @property string|null $name @@ -26,39 +26,37 @@ * @property string|null $deleted_at * @property Carbon|null $created_at * @property Carbon|null $updated_at - * * @property CountryLocale $country_locale - * - * @package App\Models */ class Category extends Model { - use SoftDeletes; - protected $table = 'categories'; + use SoftDeletes; - protected $casts = [ - 'country_locale_id' => 'int', - 'enabled' => 'bool', - 'is_top' => 'bool', - '_lft' => 'int', - '_rgt' => 'int', - 'parent_id' => 'int' - ]; + protected $table = 'categories'; - protected $fillable = [ - 'country_locale_id', - 'name', - 'short_name', - 'slug', - 'enabled', - 'is_top', - '_lft', - '_rgt', - 'parent_id' - ]; + protected $casts = [ + 'country_locale_id' => 'int', + 'enabled' => 'bool', + 'is_top' => 'bool', + '_lft' => 'int', + '_rgt' => 'int', + 'parent_id' => 'int', + ]; - public function country_locale() - { - return $this->belongsTo(CountryLocale::class); - } + protected $fillable = [ + 'country_locale_id', + 'name', + 'short_name', + 'slug', + 'enabled', + 'is_top', + '_lft', + '_rgt', + 'parent_id', + ]; + + public function country_locale() + { + return $this->belongsTo(CountryLocale::class); + } } diff --git a/app/Models/CountryLocale.php b/app/Models/CountryLocale.php index b6858ea..cb71a0d 100644 --- a/app/Models/CountryLocale.php +++ b/app/Models/CountryLocale.php @@ -12,7 +12,7 @@ /** * Class CountryLocale - * + * * @property int $id * @property string $name * @property string $slug @@ -21,22 +21,21 @@ * @property string|null $deleted_at * @property Carbon|null $created_at * @property Carbon|null $updated_at - * - * @package App\Models */ class CountryLocale extends Model { - use SoftDeletes; - protected $table = 'country_locales'; + use SoftDeletes; - protected $casts = [ - 'enabled' => 'bool' - ]; + protected $table = 'country_locales'; - protected $fillable = [ - 'name', - 'slug', - 'i18n', - 'enabled' - ]; + protected $casts = [ + 'enabled' => 'bool', + ]; + + protected $fillable = [ + 'name', + 'slug', + 'i18n', + 'enabled', + ]; } diff --git a/composer.json b/composer.json index 6cef695..6f51339 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "fakerphp/faker": "^1.9.1", - "laravel/pint": "^1.0", + "laravel/pint": "^1.10", "laravel/sail": "^1.18", "laraveldaily/larastarters": "^2.3", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 08902a7..542e062 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": "7c7dee8e0b413eb119aa5455e2d5a6ce", + "content-hash": "d4622e7e11ee1dc87e72a4ec06a255f9", "packages": [ { "name": "artesaos/seotools", diff --git a/config/models.php b/config/models.php index 9eb43c1..8226064 100644 --- a/config/models.php +++ b/config/models.php @@ -416,7 +416,7 @@ |-------------------------------------------------------------------------- | Move $fillable property to base files |-------------------------------------------------------------------------- - | When base_files is true you can set fillable_in_base_files to true + | When base_files is true you can set fillable_in_base_files to true | if you want the $fillable to be generated in base files | */ @@ -489,18 +489,18 @@ | */ -// 'connections' => [ -// 'read_only_external' => [ -// 'parent' => \App\Models\ReadOnlyModel::class, -// 'connection' => true, -// 'users' => [ -// 'connection' => false, -// ], -// 'my_other_database' => [ -// 'password_resets' => [ -// 'connection' => false, -// ] -// ] -// ], -// ], + // 'connections' => [ + // 'read_only_external' => [ + // 'parent' => \App\Models\ReadOnlyModel::class, + // 'connection' => true, + // 'users' => [ + // 'connection' => false, + // ], + // 'my_other_database' => [ + // 'password_resets' => [ + // 'connection' => false, + // ] + // ] + // ], + // ], ]; diff --git a/config/platform/general.php b/config/platform/general.php index cf2a6b8..b908656 100644 --- a/config/platform/general.php +++ b/config/platform/general.php @@ -1,7 +1,7 @@ '1.0.0', - - 'dev_default_ip' => env('DEV_DEFAULT_IP','127.0.0.1'), -]; \ No newline at end of file + 'app_version' => '1.0.0', + + 'dev_default_ip' => env('DEV_DEFAULT_IP', '127.0.0.1'), +]; diff --git a/config/seotools.php b/config/seotools.php index 5c52398..bde1e32 100644 --- a/config/seotools.php +++ b/config/seotools.php @@ -8,25 +8,25 @@ /* * The default configurations to be used by the meta generator. */ - 'defaults' => [ - 'title' => "It's Over 9000!", // set false to total remove - 'titleBefore' => false, // Put defaults.title before page title, like 'It's Over 9000! - Dashboard' - 'description' => 'For those who helped create the Genki Dama', // set false to total remove - 'separator' => ' - ', - 'keywords' => [], - 'canonical' => false, // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove - 'robots' => false, // Set to 'all', 'none' or any combination of index/noindex and follow/nofollow + 'defaults' => [ + 'title' => "It's Over 9000!", // set false to total remove + 'titleBefore' => false, // Put defaults.title before page title, like 'It's Over 9000! - Dashboard' + 'description' => 'For those who helped create the Genki Dama', // set false to total remove + 'separator' => ' - ', + 'keywords' => [], + 'canonical' => false, // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove + 'robots' => false, // Set to 'all', 'none' or any combination of index/noindex and follow/nofollow ], /* * Webmaster tags are always added. */ 'webmaster_tags' => [ - 'google' => null, - 'bing' => null, - 'alexa' => null, + 'google' => null, + 'bing' => null, + 'alexa' => null, 'pinterest' => null, - 'yandex' => null, - 'norton' => null, + 'yandex' => null, + 'norton' => null, ], 'add_notranslate_class' => false, @@ -36,12 +36,12 @@ * The default configurations to be used by the opengraph generator. */ 'defaults' => [ - 'title' => 'Over 9000 Thousand!', // set false to total remove + 'title' => 'Over 9000 Thousand!', // set false to total remove 'description' => 'For those who helped create the Genki Dama', // set false to total remove - 'url' => false, // Set null for using Url::current(), set false to total remove - 'type' => false, - 'site_name' => false, - 'images' => [], + 'url' => false, // Set null for using Url::current(), set false to total remove + 'type' => false, + 'site_name' => false, + 'images' => [], ], ], 'twitter' => [ @@ -58,11 +58,11 @@ * The default configurations to be used by the json-ld generator. */ 'defaults' => [ - 'title' => 'Over 9000 Thousand!', // set false to total remove + 'title' => 'Over 9000 Thousand!', // set false to total remove 'description' => 'For those who helped create the Genki Dama', // set false to total remove - 'url' => false, // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove - 'type' => 'WebPage', - 'images' => [], + 'url' => false, // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove + 'type' => 'WebPage', + 'images' => [], ], ], ]; diff --git a/database/migrations/2023_07_24_154301_create_categories_table.php b/database/migrations/2023_07_24_154301_create_categories_table.php index 9aa20d4..026c0a0 100644 --- a/database/migrations/2023_07_24_154301_create_categories_table.php +++ b/database/migrations/2023_07_24_154301_create_categories_table.php @@ -1,11 +1,10 @@
- +
{{ __('Welcome') }} {{ auth()->user()->name ?? null }} @@ -19,4 +18,4 @@
-@endsection \ No newline at end of file +@endsection diff --git a/resources/views/admin/users/index.blade.php b/resources/views/admin/users/index.blade.php index 98c667f..d335154 100644 --- a/resources/views/admin/users/index.blade.php +++ b/resources/views/admin/users/index.blade.php @@ -28,21 +28,21 @@ - @foreach($users as $user) - - {{ $user->name }} - {{ $user->email }} - {{ $user->created_at }} - {{ $user->updated_at->diffForhumans() }} - - @endforeach + @foreach ($users as $user) + + {{ $user->name }} + {{ $user->email }} + {{ $user->created_at }} + {{ $user->updated_at->diffForhumans() }} + + @endforeach
- @if( $users->hasPages() ) - + @if ($users->hasPages()) + @endif diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 8092617..62f134b 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -9,9 +9,11 @@
- + @error('email') -
{{ $message }}
+
{{ $message }}
@enderror
@@ -19,14 +21,15 @@ - + @error('password') -
{{ $message }}
+
{{ $message }}
@enderror @@ -44,9 +47,8 @@ @if (Route::has('register')) -
- {{ __("Don't have account yet?") }} {{ __('Sign up') }} -
+
+ {{ __("Don't have account yet?") }} {{ __('Sign up') }} +
@endif - @endsection diff --git a/resources/views/auth/passwords/confirm.blade.php b/resources/views/auth/passwords/confirm.blade.php index f2eacb6..50e4bc6 100644 --- a/resources/views/auth/passwords/confirm.blade.php +++ b/resources/views/auth/passwords/confirm.blade.php @@ -13,14 +13,16 @@ - + @error('password') -
{{ $message }}
+
{{ $message }}
@enderror diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 152a33b..6800a87 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -1,11 +1,10 @@ @extends('layouts.admin.guest') @section('content') - @if (session('status')) - + @endif
@@ -14,16 +13,19 @@

{{ __('Forgot password') }}

-

{{ __('Enter your email address and your password will be reset and emailed to you.') }}

+

+ {{ __('Enter your email address and your password will be reset and emailed to you.') }}

- + @error('email') -
{{ $message }}
+
{{ $message }}
@enderror
- +
- \ No newline at end of file + diff --git a/resources/views/layouts/front/app.blade.php b/resources/views/layouts/front/app.blade.php index c818d46..b274819 100644 --- a/resources/views/layouts/front/app.blade.php +++ b/resources/views/layouts/front/app.blade.php @@ -16,6 +16,7 @@ @include('layouts.front.header') + @include('layouts.front.navigation') @@ -31,4 +32,5 @@ @yield('custom_scripts') + diff --git a/resources/views/layouts/front/footer.blade.php b/resources/views/layouts/front/footer.blade.php index 1855257..6ef6495 100644 --- a/resources/views/layouts/front/footer.blade.php +++ b/resources/views/layouts/front/footer.blade.php @@ -1,59 +1,73 @@
- -
\ No newline at end of file +
+

© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.

+ +
+ + diff --git a/resources/views/layouts/front/header.blade.php b/resources/views/layouts/front/header.blade.php index e69de29..8b13789 100644 --- a/resources/views/layouts/front/header.blade.php +++ b/resources/views/layouts/front/header.blade.php @@ -0,0 +1 @@ + diff --git a/resources/views/layouts/front/navigation.blade.php b/resources/views/layouts/front/navigation.blade.php index 4de3abb..cc2c2b1 100644 --- a/resources/views/layouts/front/navigation.blade.php +++ b/resources/views/layouts/front/navigation.blade.php @@ -1,52 +1,55 @@
-
-
- -
-
-

{{ config('app.name') }}

- -
-
-
-
- -

{{ config('app.name') }}

-
-
- - -
-
- - - \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 659abcd..4b3951a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -19,12 +19,10 @@ Auth::routes(); - Route::prefix('admin')->middleware('auth')->group(function () { Route::get('/', [App\Http\Controllers\Admin\DashboardController::class, 'index'])->name('dashboard'); - Route::view('about', 'admin.about')->name('about'); Route::get('users', [\App\Http\Controllers\Admin\UserController::class, 'index'])->name('users.index');