fix: 🐛 delete order column on products table

This commit is contained in:
Corentin Huet 2026-04-29 16:23:41 +02:00
parent 73920cf1fd
commit 4bda1ee99b
3 changed files with 27 additions and 3 deletions

View file

@ -12,7 +12,6 @@ use App\Models\Range;
use App\Models\Subrange;
use App\Models\Tag;
use App\Traits\Controllers\UpdateModelPublished;
use App\Traits\Controllers\ChangesModelOrder;
use App\Traits\Controllers\ManagesOrder;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
@ -20,7 +19,6 @@ use Illuminate\Support\Str;
class ProductController extends Controller
{
use ChangesModelOrder;
use UpdateModelPublished;
use ManagesOrder;

View file

@ -85,7 +85,6 @@ class Product extends Model implements SeoInterface, Sitemapable, RedirectableIn
'is_frenchpoultry',
'is_vip',
'is_egalim',
'order',
'published',
'priority_order',
];
@ -116,6 +115,7 @@ class Product extends Model implements SeoInterface, Sitemapable, RedirectableIn
{
// * EVENT CLOSURES.
static::creating(function (self $model) {
self::setOrder($model);
self::manageFields($model);
self::bootOrderable($model);
});

View file

@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('products', function (Blueprint $table) {
$table->dropColumn('order');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
$table->integer('order')->comment('Ordre du slide');
}
};