feat: add is_premium
This commit is contained in:
@@ -50,6 +50,7 @@ public function store(Request $request)
|
||||
'detail_image' => 'nullable|file|extensions:jpg,jpeg,png,gif,webp,bmp,svg|max:8192',
|
||||
'order' => 'nullable|integer',
|
||||
'is_active' => 'nullable|boolean',
|
||||
'is_premium' => 'nullable|boolean',
|
||||
]);
|
||||
|
||||
// Ensure at least one category or subcategory is provided
|
||||
@@ -144,6 +145,7 @@ public function update(Request $request, $id)
|
||||
'detail_image' => 'nullable|file|extensions:jpg,jpeg,png,gif,webp,bmp,svg|max:8192',
|
||||
'order' => 'nullable|integer',
|
||||
'is_active' => 'nullable|boolean',
|
||||
'is_premium' => 'nullable|boolean',
|
||||
]);
|
||||
|
||||
if (isset($data['name'])) {
|
||||
|
||||
@@ -16,11 +16,12 @@ class MusicPlaylist extends Model
|
||||
protected $table = 'music_playlists';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'slug', 'description', 'image_id', 'detail_image_id', 'order', 'is_active'
|
||||
'name', 'slug', 'description', 'image_id', 'detail_image_id', 'order', 'is_active', 'is_premium'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_active' => 'boolean',
|
||||
'is_premium' => 'boolean',
|
||||
'order' => 'integer',
|
||||
];
|
||||
protected $appends = [
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('music_playlists', function (Blueprint $table) {
|
||||
$table->boolean('is_premium')->default(false)->after('is_active');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('music_playlists', function (Blueprint $table) {
|
||||
$table->dropColumn('is_premium');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user