✨
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

Database

The Database attribute allows you to customize the database connection, table and timestamps of your model.

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

#[Database(connection: 'pgsql', table: 'custom_products', timestamps: false)]
final class Product extends Model
{
    use Virtue;
}
PreviousCastNextDispatches Events

Last updated 1 year ago

Was this helpful?

🛠️