✅ GroupController (index, create, store, edit, update, destroy) ✅ GroupPolicy (viewAny, view, create, update, delete) ✅ Маршруты: /admin/organizations/{organization}/groups (shallow resource) ✅ Blade-шаблоны: - admin/groups/index.blade.php (список групп организации) - admin/groups/create.blade.php (форма создания) - admin/groups/edit.blade.php (форма редактирования) ✅ Обновлён admin/organizations/show.blade.php (управление группами) ✅ Обновлён AuthServiceProvider (регистрация GroupPolicy) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
31 lines
687 B
PHP
Executable File
31 lines
687 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Group;
|
|
use App\Models\Organization;
|
|
use App\Policies\GroupPolicy;
|
|
use App\Policies\OrganizationPolicy;
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* The model to policy mappings for the application.
|
|
*
|
|
* @var array<class-string, class-string>
|
|
*/
|
|
protected $policies = [
|
|
Organization::class => OrganizationPolicy::class,
|
|
Group::class => GroupPolicy::class,
|
|
];
|
|
|
|
/**
|
|
* Register any authentication / authorization services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|