feat: add btn text

This commit is contained in:
2026-06-25 10:07:42 +03:30
parent 706b349130
commit 2b5a7c9b1b
5 changed files with 36 additions and 2 deletions
@@ -36,6 +36,7 @@ public function store(Request $request)
'title' => 'required|string|max:255', 'title' => 'required|string|max:255',
'description' => 'nullable|string', 'description' => 'nullable|string',
'link' => 'nullable|string|max:500', 'link' => 'nullable|string|max:500',
'button_text' => 'nullable|string|max:255',
'start_date' => 'nullable|date', 'start_date' => 'nullable|date',
'end_date' => 'nullable|date|after_or_equal:start_date', 'end_date' => 'nullable|date|after_or_equal:start_date',
'image_id' => 'nullable|exists:images,id', 'image_id' => 'nullable|exists:images,id',
@@ -68,6 +69,7 @@ public function update(Request $request, $id)
'title' => 'sometimes|string|max:255', 'title' => 'sometimes|string|max:255',
'description' => 'nullable|string', 'description' => 'nullable|string',
'link' => 'nullable|string|max:500', 'link' => 'nullable|string|max:500',
'button_text' => 'nullable|string|max:255',
'start_date' => 'nullable|date', 'start_date' => 'nullable|date',
'end_date' => 'nullable|date|after_or_equal:start_date', 'end_date' => 'nullable|date|after_or_equal:start_date',
'image_id' => 'nullable|exists:images,id', 'image_id' => 'nullable|exists:images,id',
@@ -34,6 +34,7 @@ public function store(Request $request)
'version_name' => 'required|string|max:255', 'version_name' => 'required|string|max:255',
'version_code' => 'required|integer|min:0', 'version_code' => 'required|integer|min:0',
'link' => 'nullable|string|max:500', 'link' => 'nullable|string|max:500',
'button_text' => 'nullable|string|max:255',
'image_id' => 'nullable|exists:images,id', 'image_id' => 'nullable|exists:images,id',
'image' => 'nullable|file|extensions:jpg,jpeg,png,gif,webp,bmp,svg|max:8192', 'image' => 'nullable|file|extensions:jpg,jpeg,png,gif,webp,bmp,svg|max:8192',
]); ]);
@@ -66,6 +67,7 @@ public function update(Request $request, $id)
'version_name' => 'sometimes|string|max:255', 'version_name' => 'sometimes|string|max:255',
'version_code' => 'sometimes|integer|min:0', 'version_code' => 'sometimes|integer|min:0',
'link' => 'nullable|string|max:500', 'link' => 'nullable|string|max:500',
'button_text' => 'nullable|string|max:255',
'image_id' => 'nullable|exists:images,id', 'image_id' => 'nullable|exists:images,id',
'image' => 'nullable|file|extensions:jpg,jpeg,png,gif,webp,bmp,svg|max:8192', 'image' => 'nullable|file|extensions:jpg,jpeg,png,gif,webp,bmp,svg|max:8192',
]); ]);
+1 -1
View File
@@ -8,7 +8,7 @@
class Announcement extends Model class Announcement extends Model
{ {
protected $fillable = [ protected $fillable = [
'image_id', 'title', 'description', 'link', 'start_date', 'end_date', 'image_id', 'title', 'description', 'link', 'button_text', 'start_date', 'end_date',
]; ];
protected $casts = [ protected $casts = [
+1 -1
View File
@@ -8,7 +8,7 @@
class AppVersion extends Model class AppVersion extends Model
{ {
protected $fillable = [ protected $fillable = [
'image_id', 'title', 'description', 'version_name', 'version_code', 'link', 'image_id', 'title', 'description', 'version_name', 'version_code', 'link', 'button_text',
]; ];
protected $casts = [ protected $casts = [
@@ -0,0 +1,30 @@
<?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('announcements', function (Blueprint $table) {
$table->string('button_text')->nullable()->after('link');
});
Schema::table('app_versions', function (Blueprint $table) {
$table->string('button_text')->nullable()->after('link');
});
}
public function down(): void
{
Schema::table('announcements', function (Blueprint $table) {
$table->dropColumn('button_text');
});
Schema::table('app_versions', function (Blueprint $table) {
$table->dropColumn('button_text');
});
}
};