scaffold-model

Laravel Model Scaffold Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "scaffold-model" with this command: npx skills add iurygdeoliveira/labsis-kit/iurygdeoliveira-labsis-kit-scaffold-model

Laravel Model Scaffold Skill

Use this skill to create or modify Eloquent Models.

Rules

  1. Structure
  • Strict Types: Always declare(strict_types=1); .

  • Final: Models should be final unless they are explicitly designed for inheritance.

  • Fillable: Prefer $fillable over $guarded for explicit security.

  1. Modern Casting (Laravel 12)
  • Use the casts(): array method (Laravel 11+), NOT the $casts property.

  • Use Enums for status columns and native types.

protected function casts(): array { return [ 'status' => TicketStatus::class, 'published_at' => 'datetime', 'is_active' => 'boolean', 'options' => 'array', ]; }

  1. Relationships
  • Always add return types to relationship methods (BelongsTo , HasMany , etc.).

  • Import the relation classes (Illuminate\Database\Eloquent\Relations\BelongsTo ).

public function user(): BelongsTo { return $this->belongsTo(User::class); }

  1. Scopes
  • Use Builder type hint for scopes.

public function scopeActive(Builder $query): void { $query->where('is_active', true); }

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

scaffold-filament-resource

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-filament-page

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-controller

No summary provided by upstream source.

Repository SourceNeeds Review
General

optimize-performance

No summary provided by upstream source.

Repository SourceNeeds Review