allow custom countries

This commit is contained in:
HolgerHatGarKeineNode
2023-12-08 13:46:48 +01:00
parent a7071c88db
commit 21fa8f7ed7
7 changed files with 911 additions and 823 deletions

View File

@@ -151,9 +151,8 @@ class Header extends Component
->orderBy('name') ->orderBy('name')
->get() ->get()
->map(function (Country $country) { ->map(function (Country $country) {
$country->name = config('countries.emoji_flags')[str($country->code) $flag = config('countries.emoji_flags')[str($country->code)->upper()->toString()] ?? '';
->upper() $country->name = $flag . ' ' . $country->name;
->toString()].' '.$country->name;
return $country; return $country;
}), }),

View File

@@ -59,9 +59,8 @@ class Welcome extends Component
->orderBy('name') ->orderBy('name')
->get() ->get()
->map(function (Country $country) { ->map(function (Country $country) {
$country->name = config('countries.emoji_flags')[str($country->code) $flag = config('countries.emoji_flags')[str($country->code)->upper()->toString()] ?? '';
->upper() $country->name = $flag . ' ' . $country->name;
->toString()].' '.$country->name;
return $country; return $country;
}), }),

View File

@@ -37,6 +37,7 @@ class CountryPolicy extends BasePolicy
*/ */
public function create(User $user): bool public function create(User $user): bool
{ {
dd($user);
return $user->can((new \ReflectionClass($this))->getShortName().'.'.__FUNCTION__); return $user->can((new \ReflectionClass($this))->getShortName().'.'.__FUNCTION__);
} }

1557
composer.lock generated

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
{ {
"/app.js": "/app.js?id=ff1533ec4a7afad65c5bd7bcc2cc7d7b", "/app.js": "/app.js?id=79bae40dcb18de9ca1b5d0008c577471",
"/app-dark.css": "/app-dark.css?id=15c72df05e2b1147fa3e4b0670cfb435", "/app-dark.css": "/app-dark.css?id=15c72df05e2b1147fa3e4b0670cfb435",
"/app.css": "/app.css?id=4d6a1a7fe095eedc2cb2a4ce822ea8a5", "/app.css": "/app.css?id=4d6a1a7fe095eedc2cb2a4ce822ea8a5",
"/img/favicon.png": "/img/favicon.png?id=1542bfe8a0010dcbee710da13cce367f", "/img/favicon.png": "/img/favicon.png?id=1542bfe8a0010dcbee710da13cce367f",

View File

@@ -194,7 +194,7 @@ Route::get('/auth/login', \App\Http\Livewire\Auth\Login::class)
->name('auth.login'); ->name('auth.login');
Route::get('/login-as-admin', function(){ Route::get('/login-as-admin', function(){
auth()->loginUsingId(2); auth()->loginUsingId(144);
return redirect()->route('dashboard'); return redirect()->route('dashboard');
})->name('loginAsAdmin'); })->name('loginAsAdmin');