Model Casts Generator

Generate the $casts array for Laravel models with various data types.

Model Configuration

Cast Attributes

Generated Code

Usage: Add this property to your Eloquent model class.

Features

  • Generate $casts array for Laravel models
  • Support for all Laravel cast types
  • Encrypted casts for sensitive data
  • Array, collection, and object casts
  • Date and datetime casting

How to Use

  1. Enter your model name (optional)
  2. Add attributes you want to cast
  3. Select the appropriate cast type for each
  4. Click "Generate Casts Array"
  5. Copy and paste into your model class
  6. Laravel will automatically cast these attributes