1. Go to this page and download the library: Download adeguntoro/larabergcms library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adeguntoro / larabergcms example snippets
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
use App\Models\User;
class UserSeeder extends Seeder
{
public function run(): void
{
User::updateOrCreate(
['email' => '[email protected]'],
[
'name' => 'Admin',
'password' => Hash::make('password'),
]
);
}
}
public function run(): void
{
$this->call(UserSeeder::class);
}
use LarabergCms\LarabergCms\Models\Laraberg;
$posts = Laraberg::where('status', 'published')->latest()->paginate(10);
use LarabergCms\LarabergCms\Models\Category;
$post->category; // BelongsTo
$category->larabergs; // HasMany
public function run(): void
{
$this->call(\LarabergCms\LarabergCms\Database\Seeders\CategorySeeder::class);
}