lyrasoft/event-booking

LYRASOFT Event Booking Package

Installs: 52

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 5

Type:windwalker-package

0.1.1 2024-07-22 08:42 UTC

This package is auto-updated.

Last update: 2024-11-22 09:17:14 UTC


README

Installation

Install from composer

composer require lyrasoft/event-booking

EventBooking dependents on lyrasoft/sequence Please read their README and configure them first.

Then copy files to project

php windwalker pkg:install lyrasoft/event-booking -t routes -t migrations -t seeders

Seeders

Add these files to resources/seeders/main.php

return [
    // ...
    
    __DIR__ . '/venue-seeder.php',
    __DIR__ . '/event-seeder.php',
    __DIR__ . '/event-order-seeder.php',
];

Add these types to category-seeder.php

    static function () use ($seeder, $orm, $db) {
        $types = [
            // ...
            
            'event' => [
                'max_level' => 1,
                'number' => 10,
            ],
            
            // Venue catagoey is optional
            'venue' => [
                'max_level' => 1,
                'number' => 5,
            ],
        ];

Global Settings

WIP

Session

As EventBooking may need to redirect to outside Payment service to process checkout, you must disable SameSite cookie poilicy and set secure as TRUE.

// etc/packages/session.php

return [
    'session' => [
        // ...

        'cookie_params' => [
            // ...
            'secure' => true, // <-- Set this to TRUE
            // ...
            'samesite' => CookiesInterface::SAMESITE_NONE, // Set this to `SAMESITE_NONE`
        ],

Language Files

Add this line to admin & front middleware if you don't want to override languages:

$this->lang->loadAllFromVendor('lyrasoft/shopgo', 'ini');

// OR
$this->lang->loadAllFromVendor(EventBookingPackage::class, 'ini');

Or run this command to copy languages files:

php windwalker pkg:install lyrasoft/shopgo -t lang

Register Admin Menu

Edit resources/menu/admin/sidemenu.menu.php

$menu->link('活動', '#')
    ->icon('fal fa-calendar');

$menu->registerChildren(
    function (MenuBuilder $menu) use ($nav, $lang) {        
        $menu->link('場館管理')
            ->to($nav->to('venue_list'))
            ->icon('fal fa-house-flag');
        
        $menu->link('活動分類')
            ->to($nav->to('category_list')->var('type', 'event'))
            ->icon('fal fa-sitemap');
        
        $menu->link('活動管理')
            ->to($nav->to('event_list'))
            ->icon('fal fa-calendar-days');
        
        $menu->link('報名者管理')
            ->to($nav->to('event_attend_list'))
            ->icon('fal fa-users');
        
        $menu->link('報名訂單管理')
            ->to($nav->to('event_order_list'))
            ->icon('fal fa-files');
    }
);