Agus Sudarmanto
Posted on January 4, 2024
# What is Filament
The Filament Panel Builder pre-installs the Form Builder, Table Builder, Notifications, Actions, Infolists, and Widgets packages
# Install Laravel
laravel new {folder-or-application-name}
- or -
composer create-project laravel/laravel {folder-or-application-name}
# Install Filament Package
composer require filament/filament:"^3.0-stable" -W
php artisan filament:install --panels
# Create a user
php artisan make:filament-user
# Publishable configuration
php artisan vendor:publish --tag=filament-config
php artisan vendor:publish --tag=filament-panels-translations
php artisan vendor:publish --tag=filament-actions-translations
php artisan vendor:publish --tag=filament-forms-translations
php artisan vendor:publish --tag=filament-notifications-translations
php artisan vendor:publish --tag=filament-tables-translations
php artisan vendor:publish --tag=filament-translations
# Panel Builder
Panels are a container for pages, resources, forms, tables, notifications, actions, info lists, and widgets.
## Make models
php artisan make:model Owner -m
php artisan make:model Patient -m
php artisan make:model Treatment -m
// create_owners_table
Schema::create('owners', function (Blueprint $table) {
$table->id();
$table->string('email');
$table->string('name');
$table->string('phone');
$table->timestamps();
});
// create_patients_table
Schema::create('patients', function (Blueprint $table) {
$table->id();
$table->date('date_of_birth');
$table->string('name');
$table->foreignId('owner_id')->constrained('owners')->cascadeOnDelete();
$table->string('type');
$table->timestamps();
});
// create_treatments_table
Schema::create('treatments', function (Blueprint $table) {
$table->id();
$table->string('description');
$table->text('notes')->nullable();
$table->foreignId('patient_id')->constrained('patients')->cascadeOnDelete();
$table->unsignedInteger('price')->nullable();
$table->timestamps();
});
run php artisan migrate
References
💖 💪 🙅 🚩
Agus Sudarmanto
Posted on January 4, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.