Skip to content

A Twill Capsule to create a Home page for your website

License

Notifications You must be signed in to change notification settings

joyceverheije/twill-capsule-homepages

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homepages Capsule

A Twill Capsule to create a Home page for your website

screenshot

Description

This Capsule aims to create a single page home page and for that it ensures you will always have one and only one homepage record on your database.

It also contains a middleware to shut down your website (like the php artisan down command) when unpublishing the homepage:

protected $middleware = [
    ...
    \App\Twill\Capsules\Homepages\Http\Middleware\Shutdown::class,
];

Please make sure your users have the proper permissions to edit/unpublish the homepage.

Installing

If you are using the twill:capsule:install, make sure Twill/Capsules directory exists (bug will be fixed soon):

mkdir -p app/Twill/Capsules

You can clone, copy the zip or do it via

php artisan twill:capsule:install homepages

Create a front.home route to your homepage:

Route::get('/', fn() => print('This is the homepage'))->name('front.home');

Navigation

Add this to twill-navigation.php to make your homepage link go directly to the edit page:

return [
    'homepages' => [
        'title' => 'Homepage',

        'route' => 'admin.homepages.landing',
    ],
]

Dependencies

Crops

A base cropping systems was put in place, so for the block editor you need to configure your twill.php to be something like:

'blocks' => [
    'crops' => Crops::BLOCK_EDITOR,
],

About

A Twill Capsule to create a Home page for your website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 89.5%
  • Blade 10.5%