1. Go to this page and download the library: Download tomatophp/filament-cms 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/ */
use TomatoPHP\FilamentCms\Facades\FilamentCMS;
use TomatoPHP\FilamentCms\Services\Contracts\CmsType;
public function boot()
{
FilamentCMS::types()->register([
CmsType::make('building')
->label('Buildings')
->icon('heroicon-o-home')
->color('danger')
]);
}
use TomatoPHP\FilamentCms\Facades\FilamentCMS;
use TomatoPHP\FilamentCms\Services\Contracts\CmsAuthor;
public function boot()
{
FilamentCMS::authors()->register([
CmsAuthor::make('Admin')
->model(\App\Models\User::class)
]);
}
use TomatoPHP\FilamentCms\Services\Contracts\Section;
use TomatoPHP\FilamentCms\Facades\FilamentCMS;
use Filament\Forms\Components\TextInput;
FilamentCMS::themes()->register([
Section::make('hero')
->label('Hero Section')
->view('sections.pages.hero')
->form([
TextInput::make('title')
->label('title'),
TextInput::make('description')
->label('description'),
TextInput::make('url')
->url()
->label('url'),
TextInput::make('button')
->label('button'),
])
]);
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
$page = load_page('/');
return view('welcome', compact('page'));
});
use TomatoPHP\FilamentCms\Services\FilamentCMSFormFields;
use TomatoPHP\FilamentCms\Services\Contracts\CmsFormFieldType;
FilamentCMSFormFields::register([
CmsFormFieldType::make('code')
->className(CodeEditor::class)
->color('warning')
->icon('heroicon-s-code-bracket-square')
->label('Code Editor'),
]);
use TomatoPHP\FilamentCms\Services\FilamentCMSFormBuilder;
FilamentCMSFormBuilder::make('xvssd')->build()
use TomatoPHP\FilamentCms\Services\FilamentCMSFormBuilder;
FilamentCMSFormBuilder::make('xvssd')->send($data)
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use HasRoles;
// ...
}