customizable ticket information
This commit is contained in:
parent
a32d42feab
commit
b07238cbed
5 changed files with 21 additions and 4 deletions
|
@ -23,9 +23,10 @@ class TicketsController extends Controller
|
|||
{
|
||||
const READ_PERMISSION = 'user.ticket.read';
|
||||
const WRITE_PERMISSION = 'user.ticket.write';
|
||||
public function index(LocaleSettings $locale_settings)
|
||||
public function index(LocaleSettings $locale_settings, TicketSettings $ticketSettings)
|
||||
{
|
||||
return view('ticket.index', [
|
||||
'ticketsettings' => $ticketSettings,
|
||||
'tickets' => Ticket::where('user_id', Auth::user()->id)->paginate(10),
|
||||
'ticketcategories' => TicketCategory::all(),
|
||||
'locale_datatables' => $locale_settings->datatables
|
||||
|
|
|
@ -7,6 +7,7 @@ use Spatie\LaravelSettings\Settings;
|
|||
class TicketSettings extends Settings
|
||||
{
|
||||
public bool $enabled;
|
||||
public ?string $information;
|
||||
|
||||
public static function group(): string
|
||||
{
|
||||
|
@ -21,6 +22,7 @@ class TicketSettings extends Settings
|
|||
{
|
||||
return [
|
||||
'enabled' => 'nullable|boolean',
|
||||
'information' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -38,6 +40,11 @@ class TicketSettings extends Settings
|
|||
'type' => 'boolean',
|
||||
'description' => 'Enable or disable the ticket system.',
|
||||
],
|
||||
'information' => [
|
||||
'label' => 'Ticket Information',
|
||||
'type' => 'textarea',
|
||||
'description' => 'Message shown on the right side when users create a new ticket.',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ class CreateTicketSettings extends SettingsMigration
|
|||
|
||||
// Get the user-set configuration values from the old table.
|
||||
$this->migrator->add('ticket.enabled', $table_exists ? $this->getOldValue('SETTINGS::TICKET:ENABLED') : 'all');
|
||||
$this->migrator->add('ticket.notify', $table_exists ? $this->getOldValue('SETTINGS::TICKET:NOTIFY') : 'all');
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
|
11
database/settings/2023_05_07_195343_ticket_information.php
Normal file
11
database/settings/2023_05_07_195343_ticket_information.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
use Spatie\LaravelSettings\Migrations\SettingsMigration;
|
||||
|
||||
return new class extends SettingsMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$this->migrator->add('ticket.information', "Can't start your server? Need an additional port? Do you have any other questions? Let us know by opening a ticket.");
|
||||
}
|
||||
};
|
|
@ -66,8 +66,7 @@
|
|||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>{{__("Can't start your server? Need an additional port? Do you have any other questions? Let us know by
|
||||
opening a ticket.")}}</p>
|
||||
<p>{!! $ticketsettings->information !!}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue