lopatin96/laravel-pages

Laravel pages

Installs: 6 060

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Blade

1.0.33 2024-12-13 09:07 UTC

README

Migrations

Run migrations:

php artisan migrate

Middleware

Add PageGateChecker middleware to middleware array in app/Http/Kernel.php:

  protected $middleware = [
        
        \Atin\LaravelPages\Http\Middleware\PagesGateChecker::class,
        \Atin\LaravelPages\Http\Middleware\PersonalisedPage::class,
    ];

Folders

For each page create a folder. For example, for index.php page create app/resources/views/pages/index folder.

Config

Variables

Specify main variables (main colors, etc.)

'header_path' => 'sections.header',
    'footer_path' => 'sections.footer',

    // Colors; Add all values to tailwind.config.js as `safelist` under `module.exports`
    'gradient_from' => 'from-zinc-100',
    'gradient_to' => 'to-emerald-300',

    'text_color_primary' => 'text-emerald-400',
    'text_color_secondary' => 'text-emerald-200',

    'bg_color_primary' => 'bg-emerald-400',
    'bg_color_secondary' => 'bg-emerald-200',

    'color_primary_hex' => '#34d399',
    'color_secondary_hex' => '#a7f3d0',

    'main_button_color' => 'bg-gray-950',
…

Pages

Specify which sections your page contain.

'pages' => [
    'index' => [
        'sections' => [
            'main' => [
                'name' => 'main',
            ],
            'others' => [
                [
                    'name' => 'how-it-works',
                ],
                [
                    'name' => 'stats',
                ],
            ]
        ]
    ]
…

Publishing

Migrations

php artisan vendor:publish --tag="laravel-pages-migrations"

Localization

php artisan vendor:publish --tag="laravel-pages-lang"

Views

php artisan vendor:publish --tag="laravel-pages-views"

Config

php artisan vendor:publish --tag="laravel-pages-config"