Files
michaelschiemer/src/Framework/Admin/Attributes/AdminResource.php
Michael Schiemer 5050c7d73a docs: consolidate documentation into organized structure
- Move 12 markdown files from root to docs/ subdirectories
- Organize documentation by category:
  • docs/troubleshooting/ (1 file)  - Technical troubleshooting guides
  • docs/deployment/      (4 files) - Deployment and security documentation
  • docs/guides/          (3 files) - Feature-specific guides
  • docs/planning/        (4 files) - Planning and improvement proposals

Root directory cleanup:
- Reduced from 16 to 4 markdown files in root
- Only essential project files remain:
  • CLAUDE.md (AI instructions)
  • README.md (Main project readme)
  • CLEANUP_PLAN.md (Current cleanup plan)
  • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements)

This improves:
 Documentation discoverability
 Logical organization by purpose
 Clean root directory
 Better maintainability
2025-10-05 11:05:04 +02:00

51 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Framework\Admin\Attributes;
/**
* Admin Resource Attribute
*
* Marks a controller as an admin resource with configuration
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
final readonly class AdminResource
{
public function __construct(
public string $name,
public string $singularName,
public string $pluralName,
public string $icon = 'file',
public bool $enableApi = true,
public bool $enableCrud = true,
public array $permissions = [],
) {
}
public function getApiEndpoint(): string
{
return "/admin/api/{$this->name}";
}
public function getIndexRoute(): string
{
return "/admin/{$this->name}";
}
public function getCreateRoute(): string
{
return "/admin/{$this->name}/create";
}
public function getEditRoute(string $id): string
{
return "/admin/{$this->name}/{$id}/edit";
}
public function getShowRoute(string $id): string
{
return "/admin/{$this->name}/{$id}";
}
}