added countries support expanded for ISO 3166 standard merged in new support
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
$path = dirname(__DIR__).'/Routes/api.php';
|
$path = dirname(__DIR__).'/Routes/api.php';
|
||||||
|
|
||||||
if (is_file($path)) {
|
if (is_file($path)) {
|
||||||
Route::middleware(['api'])->group($path);
|
Route::middleware(['api'])->prefix('api/v1')->group($path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Modules\Countries\Http\Controllers\Api\CountryLookupController;
|
||||||
|
|
||||||
|
if (class_exists(CountryLookupController::class)) {
|
||||||
|
Route::get('/countries', [CountryLookupController::class, 'index'])->name('api.countries.index');
|
||||||
|
Route::get('/countries/{country:alpha2}', [CountryLookupController::class, 'show'])->name('api.countries.show');
|
||||||
|
}
|
||||||
@@ -46,7 +46,7 @@ trait BuildsHelpdeskFixtures
|
|||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function status(array $attributes = []): Status
|
protected function ticketStatus(array $attributes = []): Status
|
||||||
{
|
{
|
||||||
return Status::query()->create(array_merge([
|
return Status::query()->create(array_merge([
|
||||||
'name' => 'Open',
|
'name' => 'Open',
|
||||||
@@ -59,7 +59,7 @@ trait BuildsHelpdeskFixtures
|
|||||||
|
|
||||||
protected function closedStatus(array $attributes = []): Status
|
protected function closedStatus(array $attributes = []): Status
|
||||||
{
|
{
|
||||||
return $this->status(array_merge([
|
return $this->ticketStatus(array_merge([
|
||||||
'name' => 'Closed',
|
'name' => 'Closed',
|
||||||
'slug' => fake()->unique()->slug(2),
|
'slug' => fake()->unique()->slug(2),
|
||||||
'color' => 'emerald',
|
'color' => 'emerald',
|
||||||
@@ -136,7 +136,7 @@ trait BuildsHelpdeskFixtures
|
|||||||
'reference' => 'HD-'.now()->format('Y').'-'.str_pad((string) random_int(1, 99999), 5, '0', STR_PAD_LEFT),
|
'reference' => 'HD-'.now()->format('Y').'-'.str_pad((string) random_int(1, 99999), 5, '0', STR_PAD_LEFT),
|
||||||
'user_id' => $owner->id,
|
'user_id' => $owner->id,
|
||||||
'agent_id' => $agent?->id,
|
'agent_id' => $agent?->id,
|
||||||
'status_id' => $this->status()->id,
|
'status_id' => $this->ticketStatus()->id,
|
||||||
'priority_id' => $this->priority()->id,
|
'priority_id' => $this->priority()->id,
|
||||||
'category_id' => null,
|
'category_id' => null,
|
||||||
'project_id' => null,
|
'project_id' => null,
|
||||||
@@ -149,7 +149,7 @@ trait BuildsHelpdeskFixtures
|
|||||||
|
|
||||||
protected function seedLookupData(): array
|
protected function seedLookupData(): array
|
||||||
{
|
{
|
||||||
$open = $this->status(['name' => 'Open', 'slug' => 'open']);
|
$open = $this->ticketStatus(['name' => 'Open', 'slug' => 'open']);
|
||||||
$closed = $this->closedStatus(['name' => 'Closed', 'slug' => 'closed']);
|
$closed = $this->closedStatus(['name' => 'Closed', 'slug' => 'closed']);
|
||||||
$normal = $this->priority(['name' => 'Normal', 'slug' => 'normal']);
|
$normal = $this->priority(['name' => 'Normal', 'slug' => 'normal']);
|
||||||
$high = $this->priority(['name' => 'High', 'slug' => 'high', 'color' => 'red', 'sort_order' => 1]);
|
$high = $this->priority(['name' => 'High', 'slug' => 'high', 'color' => 'red', 'sort_order' => 1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user