run through pint

This commit is contained in:
2023-11-23 15:34:20 +05:00
parent fe68420bab
commit 7372435e56
9 changed files with 9 additions and 25 deletions

View File

@@ -11,6 +11,7 @@ class Branch extends Model
/** /**
* Table name * Table name
*
* @var string * @var string
*/ */
protected $table = 'branches'; protected $table = 'branches';

View File

@@ -10,7 +10,6 @@ abstract class Resource extends NovaResource
/** /**
* Build an "index" query for the given resource. * Build an "index" query for the given resource.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder * @return \Illuminate\Database\Eloquent\Builder
*/ */
@@ -22,7 +21,6 @@ abstract class Resource extends NovaResource
/** /**
* Build a Scout search query for the given resource. * Build a Scout search query for the given resource.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @param \Laravel\Scout\Builder $query * @param \Laravel\Scout\Builder $query
* @return \Laravel\Scout\Builder * @return \Laravel\Scout\Builder
*/ */
@@ -34,7 +32,6 @@ abstract class Resource extends NovaResource
/** /**
* Build a "detail" query for the given resource. * Build a "detail" query for the given resource.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder * @return \Illuminate\Database\Eloquent\Builder
*/ */
@@ -48,7 +45,6 @@ abstract class Resource extends NovaResource
* *
* This query determines which instances of the model may be attached to other resources. * This query determines which instances of the model may be attached to other resources.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder * @return \Illuminate\Database\Eloquent\Builder
*/ */

View File

@@ -2,6 +2,7 @@
namespace App\Nova\Resources\Branch; namespace App\Nova\Resources\Branch;
use App\Models\Branch\Branch as BranchModel;
use App\Nova\Resources\Branch\Concerns\BranchNovaRepo; use App\Nova\Resources\Branch\Concerns\BranchNovaRepo;
use App\Repos\System\Settings\Location\RegionRepo; use App\Repos\System\Settings\Location\RegionRepo;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@@ -9,7 +10,6 @@ use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Select; use Laravel\Nova\Fields\Select;
use Laravel\Nova\Http\Requests\NovaRequest; use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Resource; use Laravel\Nova\Resource;
use \App\Models\Branch\Branch as BranchModel;
class Branch extends Resource class Branch extends Resource
{ {
@@ -54,9 +54,6 @@ class Branch extends Resource
/** /**
* Get the fields displayed by the resource. * Get the fields displayed by the resource.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array
*/ */
public function fields(NovaRequest $request): array public function fields(NovaRequest $request): array
{ {
@@ -79,7 +76,7 @@ class Branch extends Resource
->displayUsingLabels() ->displayUsingLabels()
->searchable() ->searchable()
->dependsOn('region', BranchNovaRepo::dependsOnRegion()), ->dependsOn('region', BranchNovaRepo::dependsOnRegion()),
Text::make(__('Unique code'), 'unique_code') Text::make(__('Unique code'), 'unique_code')
->rules('required', 'string', 'max:255'), ->rules('required', 'string', 'max:255'),
@@ -96,7 +93,6 @@ class Branch extends Resource
/** /**
* Get the cards available for the request. * Get the cards available for the request.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array * @return array
*/ */
public function cards(NovaRequest $request) public function cards(NovaRequest $request)
@@ -107,7 +103,6 @@ class Branch extends Resource
/** /**
* Get the filters available for the resource. * Get the filters available for the resource.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array * @return array
*/ */
public function filters(NovaRequest $request) public function filters(NovaRequest $request)
@@ -118,7 +113,6 @@ class Branch extends Resource
/** /**
* Get the lenses available for the resource. * Get the lenses available for the resource.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array * @return array
*/ */
public function lenses(NovaRequest $request) public function lenses(NovaRequest $request)
@@ -129,7 +123,6 @@ class Branch extends Resource
/** /**
* Get the actions available for the resource. * Get the actions available for the resource.
* *
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array * @return array
*/ */
public function actions(NovaRequest $request) public function actions(NovaRequest $request)

View File

@@ -13,8 +13,8 @@ class BranchNovaRepo
{ {
return function ($field, $request, $formData) { return function ($field, $request, $formData) {
$field->options( $field->options(
$formData->region $formData->region
? Branch::where('region', $formData->region)->pluck('name', 'id') ? Branch::where('region', $formData->region)->pluck('name', 'id')
: [] : []
); );
}; };

View File

@@ -1,7 +1,5 @@
<?php <?php
return [ return [
/** /**
@@ -13,7 +11,6 @@ return [
*/ */
'locales' => config('app.locales'), 'locales' => config('app.locales'),
/** /**
* If enabled, the Nova's current locale will always be displayed as * If enabled, the Nova's current locale will always be displayed as
* the first locale in the tabs arrangement. * the first locale in the tabs arrangement.
@@ -22,7 +19,6 @@ return [
*/ */
'prioritize_nova_locale' => true, 'prioritize_nova_locale' => true,
/** /**
* Defines the display type for the translatable tabs. * Defines the display type for the translatable tabs.
* *

View File

@@ -1,8 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration
{ {

View File

@@ -1,6 +1,5 @@
<?php <?php
use App\Repos\System\Settings\Location\RegionRepo;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,5 @@
<?php <?php
use App\Repos\System\Settings\Location\RegionRepo;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
@@ -20,7 +19,7 @@ return new class extends Migration
$table->string('region', 2)->index(); $table->string('region', 2)->index();
$table->foreignId('province_id')->constrained()->nullOnDelete(); $table->foreignId('province_id')->constrained()->nullOnDelete();
$table->string('billing_username')->nullable(); $table->string('billing_username')->nullable();
$table->string('billing_password')->nullable(); $table->string('billing_password')->nullable();
$table->timestamps(); $table->timestamps();

View File

@@ -30,7 +30,7 @@ class DatabaseSeeder extends Seeder
'admin', 'admin',
'operator', 'operator',
'user', 'user',
]; ];
foreach ($roles as $role) { foreach ($roles as $role) {
Role::create(['name' => $role]); Role::create(['name' => $role]);