Products CRUD
Database migration for products table:
php artisan make:model Product -mpublic function up()
{
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->string('image')->nullable();
$table->string('name')->unique();
$table->foreignId('brand_id');
$table->decimal('price');
$table->boolean('is_active')->default(true);
SpeedAdminHelpers::createdByUpdatedByMigrations($table);
$table->timestamps();
});
}Database migration for "category_product" table for many_to_many relation between products and categories
Add relations in Product Model
Add getGridQuery($request) function to product model

Add Grid Columns
Add form fields

Last updated