core.blade.php 880 B

123456789101112131415
  1. # PHP
  2. @php
  3. /** @var \Laravel\Boost\Install\GuidelineAssist $assist */
  4. @endphp
  5. - Always use curly braces for control structures, even for single-line bodies.
  6. - Use PHP 8 constructor property promotion: `public function __construct(public GitHub $github) { }`. Do not leave empty zero-parameter `__construct()` methods unless the constructor is private.
  7. - Use explicit return type declarations and type hints for all method parameters: `function isAccessible(User $user, ?string $path = null): bool`
  8. @if(empty($assist->enums()) || !preg_match('/[A-Z]{3,8}/', $assist->enumContents()))
  9. - Use TitleCase for Enum keys: `FavoritePerson`, `BestLake`, `Monthly`.
  10. @else
  11. - Follow existing application Enum naming conventions.
  12. @endif
  13. - Prefer PHPDoc blocks over inline comments. Only add inline comments for exceptionally complex logic.
  14. - Use array shape type definitions in PHPDoc blocks.