Skip to content

Commit

Permalink
Format Code
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io authored and github-actions[bot] committed Nov 27, 2024
1 parent 0b78c1c commit 94158fc
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public function up(): void
{
if(config('filament-cms.features.tickets')) {
if (config('filament-cms.features.tickets')) {
Schema::create('tickets', function (Blueprint $table) {
$table->id();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public function up(): void
{
if(config('filament-cms.features.tickets')) {
if (config('filament-cms.features.tickets')) {
Schema::create('ticket_comments', function (Blueprint $table) {
$table->id();

Expand Down
8 changes: 4 additions & 4 deletions resources/lang/en/messages.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

return [
"tickets" => [
"title" => "Tickets",
"single" => "Ticket"
]
'tickets' => [
'title' => 'Tickets',
'single' => 'Ticket',
],
];
5 changes: 2 additions & 3 deletions src/Console/FilamentSupportInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function __construct()
parent::__construct();
}


/**
* Execute the console command.
*
Expand All @@ -37,8 +36,8 @@ public function __construct()
public function handle()
{
$this->info('Publish Vendor Assets');
$this->artisanCommand(["migrate"]);
$this->artisanCommand(["optimize:clear"]);
$this->artisanCommand(['migrate']);
$this->artisanCommand(['optimize:clear']);
$this->info('Filament support installed successfully.');
}
}
7 changes: 2 additions & 5 deletions src/Filament/Resources/TicketCommentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource\Pages;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource\RelationManagers;
use TomatoPHP\FilamentSupport\Models\TicketComment;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource\Pages;
use TomatoPHP\FilamentSupport\Models\TicketComment;

class TicketCommentResource extends Resource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource\Pages;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource;

class CreateTicketComment extends CreateRecord
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource\Pages;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource;

class EditTicketComment extends EditRecord
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource\Pages;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketCommentResource;

class ListTicketComments extends ListRecords
{
Expand Down
7 changes: 2 additions & 5 deletions src/Filament/Resources/TicketResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource\Pages;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource\RelationManagers;
use TomatoPHP\FilamentSupport\Models\Ticket;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource\Pages;
use TomatoPHP\FilamentSupport\Models\Ticket;

class TicketResource extends Resource
{
Expand Down
3 changes: 1 addition & 2 deletions src/Filament/Resources/TicketResource/Pages/CreateTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources\TicketResource\Pages;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource;

class CreateTicket extends CreateRecord
{
Expand Down
2 changes: 1 addition & 1 deletion src/Filament/Resources/TicketResource/Pages/EditTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources\TicketResource\Pages;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource;

class EditTicket extends EditRecord
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace TomatoPHP\FilamentSupport\Filament\Resources\TicketResource\Pages;

use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
use TomatoPHP\FilamentSupport\Filament\Resources\TicketResource;

class ListTickets extends ListRecords
{
Expand Down
1 change: 0 additions & 1 deletion src/FilamentSupportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class FilamentSupportPlugin implements Plugin
{

public function getId(): string
{
return 'filament-support';
Expand Down
16 changes: 7 additions & 9 deletions src/FilamentSupportServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,37 @@

use Illuminate\Support\ServiceProvider;


class FilamentSupportServiceProvider extends ServiceProvider
{
public function register(): void
{
//Register generate command
$this->commands([
\TomatoPHP\FilamentSupport\Console\FilamentSupportInstall::class,
\TomatoPHP\FilamentSupport\Console\FilamentSupportInstall::class,
]);

//Register Config file
$this->mergeConfigFrom(__DIR__.'/../config/filament-support.php', 'filament-support');
$this->mergeConfigFrom(__DIR__ . '/../config/filament-support.php', 'filament-support');

//Publish Config
$this->publishes([
__DIR__.'/../config/filament-support.php' => config_path('filament-support.php'),
__DIR__ . '/../config/filament-support.php' => config_path('filament-support.php'),
], 'filament-support-config');

//Register Migrations
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');

//Publish Migrations
$this->publishes([
__DIR__.'/../database/migrations' => database_path('migrations'),
__DIR__ . '/../database/migrations' => database_path('migrations'),
], 'filament-support-migrations');


//Register Langs
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'filament-support');
$this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'filament-support');

//Publish Lang
$this->publishes([
__DIR__.'/../resources/lang' => base_path('lang/vendor/filament-support'),
__DIR__ . '/../resources/lang' => base_path('lang/vendor/filament-support'),
], 'filament-support-lang');
}

Expand Down
14 changes: 8 additions & 6 deletions src/Models/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
use Illuminate\Database\Eloquent\Model;

/**
* @property integer $id
* @property integer $type_id
* @property int $id
* @property int $type_id
* @property string $accountable_type
* @property integer $accountable_id
* @property int $accountable_id
* @property string $name
* @property string $phone
* @property string $subject
* @property string $code
* @property string $message
* @property string $last_update
* @property boolean $is_closed
* @property bool $is_closed
* @property string $created_at
* @property string $updated_at
* @property TicketComment[] $ticketComments
Expand All @@ -29,8 +29,9 @@ class Ticket extends Model
protected $fillable = ['type_id', 'accountable_type', 'accountable_id', 'name', 'phone', 'subject', 'code', 'message', 'last_update', 'is_closed', 'created_at', 'updated_at'];

protected $casts = [
'is_closed' => 'boolean'
'is_closed' => 'boolean',
];

/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
Expand All @@ -47,7 +48,8 @@ public function type()
return $this->belongsTo('TomatoPHP\FilamentSupport\Models\Type');
}

public function accountable(){
public function accountable()
{
return $this->morphTo();
}
}
6 changes: 3 additions & 3 deletions src/Models/TicketComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
use Illuminate\Database\Eloquent\Model;

/**
* @property integer $id
* @property integer $ticket_id
* @property int $id
* @property int $ticket_id
* @property string $accountable_type
* @property integer $accountable_id
* @property int $accountable_id
* @property string $response
* @property string $created_at
* @property string $updated_at
Expand Down
1 change: 0 additions & 1 deletion tests/src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Orchestra\Testbench\TestCase as BaseTestCase;
use RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider;
use TomatoPHP\FilamentSupport\FilamentSupportServiceProvider;
use TomatoPHP\FilamentSupport\Tests\Models\User;

abstract class TestCase extends BaseTestCase
{
Expand Down

0 comments on commit 94158fc

Please sign in to comment.