PHP code example of magicoli / two-way-ticket

1. Go to this page and download the library: Download magicoli/two-way-ticket 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/ */

    

magicoli / two-way-ticket example snippets


use Magicoli\TwoWayTicket\ReportIssuePlugin;
use Magicoli\TwoWayTicket\TicketsPlugin;

$panel
    ->plugins([
        TicketsPlugin::make(),
        ReportIssuePlugin::make(),
    ])

use Magicoli\TwoWayTicket\ReportIssuePlugin;

$panel
    ->plugins([
        ReportIssuePlugin::make(),
    ])

$panel
    ->plugins([
        TicketsPlugin::make()->visible(fn (): bool => auth()->user()?->isAdmin() ?? false),
        ReportIssuePlugin::make()->visible(true),
    ])
    ->widgets([
        TicketStatsWidget::make()->visible(fn (): bool => auth()->user()?->isAdmin() ?? false),
    ]);

use Illuminate\Support\Facades\Gate;
use Magicoli\TwoWayTicket\Models\Ticket;

public function boot(): void
{
    Gate::policy(Ticket::class, \App\Policies\TicketPolicy::class);
}
bash
php artisan boost:install          # Laravel 12
php artisan boost:update --discover # Laravel 13
bash
php artisan vendor:publish --tag=two-way-ticket-translations
php artisan vendor:publish --tag=two-way-ticket-styles
php artisan vendor:publish --tag=two-way-ticket-migrations