firstcommit

This commit is contained in:
2025-08-17 16:23:14 +05:45
commit 76bf4c0a18
2648 changed files with 362795 additions and 0 deletions

View File

View File

@@ -0,0 +1,37 @@
<?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('blogs', function (Blueprint $table) {
$table->id();
$table->uuid();
$table->string('title');
$table->string('author');
$table->text('summary');
$table->text('content');
$table->timestamp('published_date');
$table->string('image')->nullable();
$table->string('image_path')->nullable();
$table->string('status')->default('active');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('blogs');
}
};

View File

@@ -0,0 +1,34 @@
<?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('blog_metas', function (Blueprint $table) {
$table->id();
$table->uuid();
$table->unsignedBigInteger('blog_id');
$table->string('meta_title')->nullable();
$table->longText('meta_description')->nullable();
$table->longText('meta_keywords')->nullable();
$table->softDeletes();
$table->timestamps();
$table->foreign('blog_id')->references('id')->on('blogs');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('blog_metas');
}
};

View File

@@ -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('blogs', function (Blueprint $table) {
$table->string('slug', 300)->after('title');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('blogs', function (Blueprint $table) {
$table->dropColumn('slug');
});
}
};

View File

@@ -0,0 +1,2 @@
<?php
blogs

View File

View File

@@ -0,0 +1,93 @@
<?php
namespace Modules\Blog\database\seeders;
use Carbon\Carbon;
use Illuminate\Support\Str;
use Illuminate\Database\Seeder;
use Modules\Blog\app\Models\Blog;
use Illuminate\Support\Facades\Storage;
class BlogDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$blogs = [
[
'title' => 'How to Reach Benagil Cave in 2023, Algarve, Portugal (Tours + Kayaking + tips)',
'content' => "Algarves Benagil Cave beach is one of those extra special ones. The only way in is by kayaking or paddle boating, which obviously adds a more elusive touch to this already amazing place.
didnt know already, the Algarve region is in the South of Portugal and is a lovely coastal area. The thing that makes the Algarve coastline unique is the stunning rock formations. They are everywhere and are mindblowing. I spent a week in Lagos and then a week in Carvoeiro both these places are in the Algarve and are stunning.
In Portuguese, the Benagil Cave is called Algar de Benagil. The holes in the rock formations are called algares (or holes) and there are many of them. I did mention in my Seven Hanging Valleys post that theres a hike that goes on top of the cliff inside which this cave is situated. You can see the holes in these cliffs from the top.
This post is about the best way of getting inside the cave from the water. Actually, there are many caves in this short stretch and they are collectively called the Benagil Caves, but in this post, we will mostly talk about the most famous Benagil Cave one with a hidden sandy beach. THIS one (below).",
'author' => 'Jhigu CMS Travel & Tour',
'summary' => 'Algarves Benagil Cave beach is one of those extra special ones. The only way in is by kayaking or paddle boating, which obviously adds a more elusive touch to this already amazing place',
'published_date' => Carbon::now(),
'image' => 'b1.jpg',
'slug' => "Slug for blog",
],
[
'title' => 'The Ultimate Italy Road Trip: 2 Weeks Itinerary (with Amalfi Coast)',
'content' => "The first time I visited Italy, it was just North Italy. We landed in Venice and drove to Trentino in our rental car. The second time was in South Italy where we spent one entire month in Puglia. We actually drove from Germany to Puglia but realized it would have been easier to just fly to Bari or Brindisi and drive a rental car from there.
For the purpose of travel, it is important to understand what are the regions of Italy. You can pick and choose some of them or get a taste of them all. Here are the regions in Italy that you can visit
Northeast Italy, (the Dolomites, Trentino, Venice and Bologna)
Northwest Italy, (Cinque Terre, Milan and the Alps)
Central Italy, (Tuscany region and Rome)
Southern Italy, (Naples, Puglia, Amalfi and Capri)
The islands Sicily and Sardinia.
If you ever see the list of the most visited countries in the world, Italy usually is in top 5 year after year. It is because there is so much to see & experience in every single region of
Keep in mind that to properly explore each region of Italy, you would probably need at least two weeks each. However, this itinerary focuses on the entire Italy, so I will help you move from one region to another and tell you the best of each. Thats the difference between a region-specific itinerary and a country-specific itinerary.
Matera in Puglia, Italy road trip two weeks itinerary via Pixabay
If you think you will get to visit Italy multiple times, then by all means pick just one region or maximum two for each trip. If youre going to visit Italy just once or twice in your life then I suggest you visit more than just 2 regions because they all have something to offer.
ont try to cover it all, it isnt possible to do so. Instead, pick a few destinations and spend some quality time in each place that you visit so that you dont feel rushed or drained out.",
'author' => 'Jhigu CMS Travel & Tour',
'summary' => 'Algarves Benagil Cave beach is one of those extra special ones. The only way in is by kayaking or paddle boating, which obviously adds a more elusive touch to this already amazing place',
'published_date' => Carbon::now(),
'image' => 'b2.jpg',
'slug' => "Slug for blog",
]
];
foreach ($blogs as $blog) {
$cmsblog = Blog::create([
'uuid' => Str::uuid(),
'title' => $blog['title'],
'content' => $blog['content'],
'author' => $blog['author'],
'summary' => $blog['summary'],
'published_date' => $blog['published_date'],
'slug' => $blog['slug'],
]);
// Add image to the created banner
$this->uploadImageForBlog($blog['image'], $cmsblog);
}
}
private function uploadImageForBlog(string $imageFileName, $cmsbanner)
{
$seederDirPath = 'Blogs/';
// Generate a unique filename for the new image
$newFileName = Str::uuid() . '.jpg';
// Storage path for the new image
$storagePath = '/blogs/' . $newFileName;
// Check if the image exists in the seeder_disk
if (Storage::disk('seeder_disk')->exists($seederDirPath . $imageFileName)) {
// Copy the image from seeder to public
$fileContents = Storage::disk('seeder_disk')->get($seederDirPath . $imageFileName);
Storage::disk('public_uploads')->put($storagePath, $fileContents);
$cmsbanner->image = $newFileName;
$cmsbanner->image_path = $storagePath;
$cmsbanner->save();
}
}
}