✨
Virtue
View on GitHub
  • ✨Virtue
  • 🚀GETTING STARTED
    • Installation
    • Changelog
  • 🛠️MODEL ATTRIBUTES
    • Configuration
    • Cast
    • Database
    • Dispatches Events
    • Fillable
    • Hidden
    • Primary Key
    • Relationships
  • 💻COMMAND ATTRIBUTES
    • Configuration
    • Defining Arguments
    • Defining Options
Powered by GitBook
On this page

Was this helpful?

  1. MODEL ATTRIBUTES

Primary Key

The PrimaryKey attribute allows you to customize the primary key of your model.

use Illuminate\Database\Eloquent\Model;
use WendellAdriel\Virtue\Models\Attributes\PrimaryKey;
use WendellAdriel\Virtue\Models\Concerns\Virtue;

#[PrimaryKey(name: 'uuid', type: 'string', incrementing: false)]
final class Product extends Model
{
    use Virtue;
}
PreviousHiddenNextRelationships

Last updated 1 year ago

Was this helpful?

🛠️