Update (all): fix php formatting using laravel pint, fix blade using shufo

This commit is contained in:
2023-07-25 22:18:01 +08:00
parent 6adc27076d
commit 82353c1ecd
37 changed files with 536 additions and 480 deletions

View File

@@ -43,4 +43,4 @@ function get_current_ip()
return $ip_add_set[0];
}
}
}

View File

@@ -1,5 +1,4 @@
<?php
require 'string_helper.php';
require 'geo_helper.php';
require 'geo_helper.php';

View File

@@ -5,7 +5,6 @@
* A better function to check if a value is empty or null. Strings, arrays, and Objects are supported.
*
* @param mixed $value
* @return bool
*/
function is_empty($value): bool
{

View File

@@ -4,9 +4,6 @@
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
/**

View File

@@ -3,9 +3,8 @@
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use App\Http\Requests\ProfileUpdateRequest;
use Illuminate\Support\Facades\Hash;
class ProfileController extends Controller
{

View File

@@ -3,7 +3,6 @@
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\User;
class UserController extends Controller

View File

@@ -3,8 +3,8 @@
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\Models\User;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
@@ -44,7 +44,6 @@ public function __construct()
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
@@ -59,7 +58,6 @@ protected function validator(array $data)
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\Models\User
*/
protected function create(array $data)

View File

@@ -3,32 +3,27 @@
namespace App\Http\Controllers\Front;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Stevebauman\Location\Facades\Location;
use App\Models\Category;
use App\Models\CountryLocale;
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function index(Request $request)
{
return redirect()->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']);
}
}

View File

@@ -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');
}
}
}
}

View File

@@ -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);
}
}

View File

@@ -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',
];
}