1. Go to this page and download the library: Download mrshanebarron/laraveldesign 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/ */
mrshanebarron / laraveldesign example snippets
use MrShaneBarron\LaravelDesign\Filament\LaravelDesignPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
LaravelDesignPlugin::make(),
]);
}
use MrShaneBarron\LaravelDesign\Models\Post;
use MrShaneBarron\LaravelDesign\Models\Page;
use MrShaneBarron\LaravelDesign\Models\Category;
use MrShaneBarron\LaravelDesign\Models\Tag;
use MrShaneBarron\LaravelDesign\Models\Menu;
use MrShaneBarron\LaravelDesign\Models\Media;
// Get published posts
$posts = Post::posts()->published()->get();
// Get published pages
$pages = Post::pages()->published()->get();
// Get menu by location
$menu = Menu::getByLocation('header');
// Get categories with post count
$categories = Category::withCount('posts')->get();