This commit is contained in:
2023-12-14 19:34:52 +05:00
parent ec46695821
commit 3d273055e8
7 changed files with 37 additions and 16 deletions

View File

@@ -10,7 +10,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Laravel\Nova\Actions\Actionable;
use Laravel\Sanctum\HasApiTokens; use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles; use Spatie\Permission\Traits\HasRoles;
@@ -151,6 +150,6 @@ class User extends Authenticatable
*/ */
public function profilePage(): string public function profilePage(): string
{ {
return '/resources/users/'. $this->id; return '/resources/users/'.$this->id;
} }
} }

View File

@@ -158,7 +158,7 @@ class CardOrder extends Resource
->rules('required') ->rules('required')
->canSeeWhen('systemUser', $this), ->canSeeWhen('systemUser', $this),
Text::make(__('Note'), 'status') Text::make(__('Note'), 'notes')
->fullWidth() ->fullWidth()
->canSeeWhen('systemUser', $this), ->canSeeWhen('systemUser', $this),

View File

@@ -48,15 +48,15 @@ class CardOrderFieldsForIndex
Text::make(__('Phone'), 'phone'), Text::make(__('Phone'), 'phone'),
Badge::make(__('Status'), 'status') // Badge::make(__('Status'), 'status')
->map(OrderRepo::statusClasses()) // ->map(OrderRepo::statusClasses())
->addTypes([ // ->addTypes([
'primary' => 'dark:bg-gray-900 bg-gray-600 text-white', // 'primary' => 'dark:bg-gray-900 bg-gray-600 text-white',
]) // ])
->labels(OrderRepo::statusValues()) // ->labels(OrderRepo::statusValues())
->withIcons() // ->withIcons()
->icons(OrderRepo::statusIcons()) // ->icons(OrderRepo::statusIcons())
->sortable(), // ->sortable(),
]; ];
} }
} }

View File

@@ -2,6 +2,7 @@
namespace App\Nova\Resources\System\Roles; namespace App\Nova\Resources\System\Roles;
use App\Models\System\Roles\Permission as PermissionModel;
use App\Nova\Resource; use App\Nova\Resource;
use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text; use Laravel\Nova\Fields\Text;
@@ -12,9 +13,9 @@ class Permission extends Resource
/** /**
* The model the resource corresponds to. * The model the resource corresponds to.
* *
* @var class-string<\App\Models\System\Roles\Permission> * @var class-string<PermissionModel>
*/ */
public static $model = \App\Models\System\Roles\Permission::class; public static $model = PermissionModel::class;
/** /**
* The single value that should be used to represent the resource when being displayed. * The single value that should be used to represent the resource when being displayed.
@@ -32,6 +33,22 @@ class Permission extends Resource
'id', 'name', 'id', 'name',
]; ];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Permissions');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Permission');
}
/** /**
* Get the fields displayed by the resource. * Get the fields displayed by the resource.
*/ */

View File

@@ -3,6 +3,7 @@
namespace App\Nova; namespace App\Nova;
use App\Nova\Resources\Branch\Branch; use App\Nova\Resources\Branch\Branch;
use App\Nova\Resources\System\Roles\Permission;
use App\Nova\Resources\System\Roles\Role; use App\Nova\Resources\System\Roles\Role;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Validation\Rules; use Illuminate\Validation\Rules;
@@ -111,6 +112,9 @@ class User extends Resource
MorphToMany::make(__('Roles'), 'roles', Role::class) MorphToMany::make(__('Roles'), 'roles', Role::class)
->canSeeWhen('isAdmin', $this), ->canSeeWhen('isAdmin', $this),
MorphToMany::make(__('Permissions'), 'permissions', Permission::class)
->canSeeWhen('isAdmin', $this),
BelongsToMany::make(__('Branches'), 'branches', Branch::class) BelongsToMany::make(__('Branches'), 'branches', Branch::class)
->canSeeWhen('isAdmin', $this), ->canSeeWhen('isAdmin', $this),
]; ];

View File

@@ -12,7 +12,6 @@ class NovaRepo
{ {
/** /**
* Initial path * Initial path
* @var string
*/ */
protected static string $initialPath = '/dashboards/main'; protected static string $initialPath = '/dashboards/main';

View File

@@ -247,5 +247,7 @@
"Loan department": "Karz bölümi", "Loan department": "Karz bölümi",
"Card department": "Kart bölümi", "Card department": "Kart bölümi",
"Price": "Baha", "Price": "Baha",
"Citizenship": "Raýatlyk" "Citizenship": "Raýatlyk",
"Permission": "Rugsat",
"Permissions": "Rugsatlar"
} }