feat: Add Logos page, refactor Testimonials to RelationManager, and improve designs
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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::create('testimonials', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('page_id')->nullable()->constrained()->onDelete('cascade');
|
||||
$table->string('name');
|
||||
$table->string('position')->nullable();
|
||||
$table->text('content');
|
||||
$table->integer('rating')->default(5);
|
||||
$table->string('avatar')->nullable();
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->integer('sort_order')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('testimonials');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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('pages', function (Blueprint $table) {
|
||||
$table->json('data')->nullable()->after('sections');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->dropColumn('data')->nullable();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Page;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class LogosPageSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$author = User::first();
|
||||
if (!$author) return;
|
||||
|
||||
$corporate = Page::where('slug', 'kurumsal')->first();
|
||||
if (!$corporate) return;
|
||||
|
||||
Page::updateOrCreate(
|
||||
['slug' => 'logolarimiz'],
|
||||
[
|
||||
'author_id' => $author->id,
|
||||
'parent_id' => $corporate->id,
|
||||
'title' => 'Logolarımız',
|
||||
'excerpt' => 'Kurumsal logolarımız ve kullanım standartları',
|
||||
'content' => null,
|
||||
'template' => 'corporate.logos',
|
||||
'status' => 'published',
|
||||
'is_homepage' => false,
|
||||
'show_in_menu' => true,
|
||||
'sort_order' => 6,
|
||||
'published_at' => now(),
|
||||
]
|
||||
);
|
||||
|
||||
$this->command->info('✅ Logolarımız sayfası başarıyla eklendi!');
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ class PageSeeder extends Seeder
|
||||
);
|
||||
|
||||
// 2.5 Müşteri Görüşleri (Child of Kurumsal)
|
||||
Page::updateOrCreate(
|
||||
$testimonialsPage = Page::updateOrCreate(
|
||||
['slug' => 'musteri-gorusleri'],
|
||||
[
|
||||
'author_id' => $author->id,
|
||||
@@ -149,6 +149,38 @@ class PageSeeder extends Seeder
|
||||
]
|
||||
);
|
||||
|
||||
// Varsayılan müşteri görüşlerini ekle
|
||||
$defaultTestimonials = [
|
||||
[
|
||||
'name' => 'Kerem Can Azak',
|
||||
'position' => 'Stellar Construction',
|
||||
'content' => 'Dijital dönüşüm yolculuğumuzda yanımızda oldukları için mutluyuz. Profesyonel yaklaşımları ve çözüm odaklı çalışmaları ile projelerimize değer kattılar.',
|
||||
'rating' => 5,
|
||||
'sort_order' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Servet Demir',
|
||||
'position' => 'Dijimind Akademi',
|
||||
'content' => 'Eğitim teknolojileri alanındaki vizyoner bakış açıları ve teknik altyapı konusundaki uzmanlıkları sayesinde hedeflediğimiz kitleye çok daha etkili bir şekilde ulaştık.',
|
||||
'rating' => 5,
|
||||
'sort_order' => 2,
|
||||
],
|
||||
[
|
||||
'name' => 'A. Cezmi Savaş',
|
||||
'position' => 'Rhapsode Akademik Yayınevi',
|
||||
'content' => 'Akademik yayıncılık süreçlerimizi dijitalleştirirken sundukları yenilikçi çözümler ve hızlı destekleri için teşekkür ederiz. Güvenilir bir iş ortağı.',
|
||||
'rating' => 5,
|
||||
'sort_order' => 3,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($defaultTestimonials as $testimonialData) {
|
||||
\App\Models\Testimonial::updateOrCreate(
|
||||
['page_id' => $testimonialsPage->id, 'name' => $testimonialData['name']],
|
||||
$testimonialData
|
||||
);
|
||||
}
|
||||
|
||||
// 3. Ürünlerimiz (Mega Menu Target)
|
||||
Page::updateOrCreate(
|
||||
['slug' => 'urunlerimiz'],
|
||||
|
||||
Reference in New Issue
Block a user