From e98b7777cb4acfc0a4b0a1dae766b3587a1db445 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 13 Mar 2024 16:13:39 +0000 Subject: [PATCH] Apply fixes from StyleCI --- app/Filament/Pages/DAbovilleReportPage.php | 1 - app/Filament/Pages/ManageSubscription.php | 3 - app/Filament/Pages/PedigreeChartPage.php | 1 - app/Filament/Pages/PeopleDashboard.php | 1 - app/Filament/Pages/Tenancy/RegisterTeam.php | 2 +- app/Filament/Resources/DnaResource.php | 6 +- app/Filament/Resources/FamilyResource.php | 5 +- app/Filament/Resources/GedcomResource.php | 30 ++++--- app/Filament/Resources/PersonResource.php | 84 ++++++++++--------- .../Widgets/DabovilleReportWidget.php | 19 ++--- .../Widgets/DescendantChartWidget.php | 4 +- app/Filament/Widgets/FanChartWidget.php | 2 +- app/Filament/Widgets/PedigreeChartWidget.php | 2 +- app/Http/Controllers/ContactController.php | 8 +- app/Http/Controllers/FanChartController.php | 2 - .../Controllers/PedigreeChartController.php | 2 - app/Http/Livewire/DabovilleReport.php | 22 ++--- .../Livewire/DescendantChartComponent.php | 6 +- app/Http/Livewire/FanChart.php | 4 +- app/Http/Livewire/FanChartComponent.php | 3 +- app/Http/Livewire/PedigreeChart.php | 6 +- app/Jobs/ExportGedCom.php | 12 +-- app/Models/Team.php | 8 +- app/Providers/Filament/AdminPanelProvider.php | 16 ++-- .../Filament/PublicPanelProvider.php | 6 +- app/Providers/FilamentServiceProvider.php | 4 +- config/cashier.php | 14 ++-- config/logging.php | 6 +- config/octane.php | 2 +- .../2021_03_11_033800_create_teams.php | 2 +- routes/web.php | 10 +-- .../Filament/Resources/GedcomResourceTest.php | 9 +- .../Resources/MediaObjectResourceTest.php | 10 +-- .../Filament/Resources/NoteResourceTest.php | 4 +- .../Resources/PersonAliaResourceTest.php | 5 +- tests/Feature/Filament/SubmResourceTest.php | 9 +- tests/Feature/Filament/SubnResourceTest.php | 7 +- tests/Feature/Filament/TypeResourceTest.php | 13 ++- .../Filament/Resources/AuthorResourceTest.php | 4 +- tests/Filament/Resources/ChanResourceTest.php | 6 +- .../Resources/CitationResourceTest.php | 14 ++-- .../Resources/DnaMatchingResourceTest.php | 14 ++-- tests/Filament/Resources/DnaResourceTest.php | 1 - .../Filament/Resources/FamilyResourceTest.php | 27 +++--- .../Resources/FamilySlgsResourceTest.php | 21 ++--- .../Resources/PersonAnciResourceTest.php | 13 +-- .../Resources/PersonAssoResourceTest.php | 21 ++--- .../Resources/PersonEventResourceTest.php | 43 +++++----- .../Resources/PersonLdsResourceTest.php | 21 ++--- .../Resources/PersonNameFoneResourceTest.php | 6 +- .../Resources/PersonNameResourceTest.php | 28 +++---- .../Resources/PersonNameRomnResourceTest.php | 28 +++---- .../Filament/Resources/PersonResourceTest.php | 7 +- .../Resources/RepositoryResourceTest.php | 8 +- .../Resources/SourceDataEvenResourceTest.php | 4 +- .../Resources/SourceDataResourceTest.php | 4 +- .../Resources/SourceRefEvenResourceTest.php | 6 +- .../Resources/SourceRefResourceTest.php | 3 +- .../Resources/SourceRepoResourceTest.php | 5 +- .../Filament/Resources/SourceResourceTest.php | 45 +++++----- .../Filament/Resources/AddrResourceTest.php | 14 ++-- .../Filament/Resources/AuthorResourceTest.php | 18 ++-- .../Filament/Resources/ChanResourceTest.php | 20 ++--- 63 files changed, 345 insertions(+), 386 deletions(-) diff --git a/app/Filament/Pages/DAbovilleReportPage.php b/app/Filament/Pages/DAbovilleReportPage.php index 8c370c59..5cbd98f8 100644 --- a/app/Filament/Pages/DAbovilleReportPage.php +++ b/app/Filament/Pages/DAbovilleReportPage.php @@ -2,7 +2,6 @@ namespace App\Filament\Pages; -use App\Filament\Pages\CustomFilamentBasePage; use Livewire\Livewire; class DAbovilleReportPage extends CustomFilamentBasePage diff --git a/app/Filament/Pages/ManageSubscription.php b/app/Filament/Pages/ManageSubscription.php index a43fdeaa..9e3ead06 100644 --- a/app/Filament/Pages/ManageSubscription.php +++ b/app/Filament/Pages/ManageSubscription.php @@ -2,11 +2,8 @@ namespace App\Filament\Pages; -use App\Filament\Pages\CustomFilamentBasePage; use App\Services\StripeSubscriptionService; -use Livewire\Component; use Filament\Forms; -use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Select; class ManageSubscription extends CustomFilamentBasePage diff --git a/app/Filament/Pages/PedigreeChartPage.php b/app/Filament/Pages/PedigreeChartPage.php index 05b11d49..1f128795 100644 --- a/app/Filament/Pages/PedigreeChartPage.php +++ b/app/Filament/Pages/PedigreeChartPage.php @@ -2,7 +2,6 @@ namespace App\Filament\Pages; -use Filament\Resources\ResourcePage; use Filament\Pages\Page; class PedigreeChartPage extends Page diff --git a/app/Filament/Pages/PeopleDashboard.php b/app/Filament/Pages/PeopleDashboard.php index 7bcb4116..7c744b08 100644 --- a/app/Filament/Pages/PeopleDashboard.php +++ b/app/Filament/Pages/PeopleDashboard.php @@ -3,7 +3,6 @@ namespace App\Filament\Pages; use Filament\Pages\Page; -use Livewire\Livewire; class PeopleDashboard extends Page { diff --git a/app/Filament/Pages/Tenancy/RegisterTeam.php b/app/Filament/Pages/Tenancy/RegisterTeam.php index a882b9f3..40141f26 100644 --- a/app/Filament/Pages/Tenancy/RegisterTeam.php +++ b/app/Filament/Pages/Tenancy/RegisterTeam.php @@ -32,7 +32,7 @@ public function form(Form $form): Form resolve(TeamInvitationController::class)->sendInvitation(new Request(['email' => $email, 'team_id' => $teamId])); } }) - ->type('button') + ->type('button'), ]); } diff --git a/app/Filament/Resources/DnaResource.php b/app/Filament/Resources/DnaResource.php index 226532c3..cbb18ec6 100644 --- a/app/Filament/Resources/DnaResource.php +++ b/app/Filament/Resources/DnaResource.php @@ -22,14 +22,12 @@ class DnaResource extends Resource /** * Define the form fields and behavior for the DnaResource. - * - * @param Form $form - * - * @return Form * * @param Form $form + * @param Form $form * * @return Form + * @return Form */ public static function form(Form $form): Form { diff --git a/app/Filament/Resources/FamilyResource.php b/app/Filament/Resources/FamilyResource.php index 9a0a865c..5dabd680 100644 --- a/app/Filament/Resources/FamilyResource.php +++ b/app/Filament/Resources/FamilyResource.php @@ -9,9 +9,6 @@ use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Table; -use App\Models\Type; -use App\Models\Husband; -use App\Models\Wife; class FamilyResource extends Resource { @@ -33,7 +30,7 @@ public static function form(Form $form): Form Forms\Components\TextInput::make('husband_id') ->numeric(), Forms\Components\TextInput::make('wife_id') - ->numeric(), + ->numeric(), Forms\Components\TextInput::make('chan') ->maxLength(255), Forms\Components\TextInput::make('nchi') diff --git a/app/Filament/Resources/GedcomResource.php b/app/Filament/Resources/GedcomResource.php index a48a7f55..e29f71fc 100644 --- a/app/Filament/Resources/GedcomResource.php +++ b/app/Filament/Resources/GedcomResource.php @@ -3,18 +3,19 @@ namespace App\Filament\Resources; use App\Filament\Resources\GedcomResource\Pages; +use App\Jobs\ImportGedcom; use App\Models\Gedcom; use Filament\Forms\Components\FileUpload; use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Table; -use App\Jobs\ImportGedcom; use Illuminate\Support\Facades\Storage; -class GedcomResource extends Resource { +class GedcomResource extends Resource +{ /** - * Class GedcomResource + * Class GedcomResource. * * This class represents a resource for handling Gedcom data. * @@ -25,7 +26,7 @@ class GedcomResource extends Resource { protected static ?string $model = Gedcom::class; protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; - + public static function getPages(): array { return [ @@ -36,18 +37,14 @@ public static function getPages(): array ]; } - - - /** + /** * Define the form fields and behavior for the DnaResource. - * - * @param Form $form - * - * @return Form * * @param Form $form + * @param Form $form * * @return Form + * @return Form */ public static function form(Form $form): Form { @@ -68,10 +65,11 @@ public static function form(Form $form): Form ]); } - /** + /** * Define the table columns, filters, actions, and bulk actions. * - * @param Table $table The table object to be defined. + * @param Table $table The table object to be defined. + * * @return Table The updated table. */ public static function table(Table $table): Table @@ -97,7 +95,7 @@ public static function table(Table $table): Table ]); } - /** + /** * Perform the import functionality. * * @return array @@ -114,7 +112,7 @@ private static function import(): array public static function exportGedcom(): void { $user = auth()->user(); // Assuming the user is authenticated - $fileName = now()->format('Y-m-d_His') . '_family_tree.ged'; // Generating a unique file name + $fileName = now()->format('Y-m-d_His').'_family_tree.ged'; // Generating a unique file name ExportGedCom::dispatch($fileName, $user); } -} +} diff --git a/app/Filament/Resources/PersonResource.php b/app/Filament/Resources/PersonResource.php index 69e82123..ce0778fa 100644 --- a/app/Filament/Resources/PersonResource.php +++ b/app/Filament/Resources/PersonResource.php @@ -16,53 +16,61 @@ class PersonResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; /** - * Get the form for creating/editing a person. - * @param Form $form The form object. - * @return Form The form object. - */ -public static function form(Form $form): Form + * Get the form for creating/editing a person. + * + * @param Form $form The form object. + * + * @return Form The form object. + */ + public static function form(Form $form): Form { return $form ->schema([ /** - * Name field. - * @var TextInput - */ -TextInput::make('name') - ->required() - ->label('Name'), + * Name field. + * + * @var TextInput + */ + TextInput::make('name') + ->required() + ->label('Name'), /** - * Birth Date field. - * @var DatePicker - */ -DatePicker::make('birth_date') - ->label('Birth Date'), + * Birth Date field. + * + * @var DatePicker + */ + DatePicker::make('birth_date') + ->label('Birth Date'), /** - * Death Date field. - * @var DatePicker - */ -DatePicker::make('death_date') - ->label('Death Date'), + * Death Date field. + * + * @var DatePicker + */ + DatePicker::make('death_date') + ->label('Death Date'), /** - * Father field. - * @var SelectInput - */ -SelectInput::make('father_id') - ->relationship('father', 'name') - ->label('Father'), + * Father field. + * + * @var SelectInput + */ + SelectInput::make('father_id') + ->relationship('father', 'name') + ->label('Father'), /** - * Mother field. - * @var SelectInput - */ -SelectInput::make('mother_id') - ->relationship('mother', 'name') - ->label('Mother'), + * Mother field. + * + * @var SelectInput + */ + SelectInput::make('mother_id') + ->relationship('mother', 'name') + ->label('Mother'), /** - * Notes field. - * @var Textarea - */ -Textarea::make('notes') - ->label('Notes'), + * Notes field. + * + * @var Textarea + */ + Textarea::make('notes') + ->label('Notes'), ]); } diff --git a/app/Filament/Widgets/DabovilleReportWidget.php b/app/Filament/Widgets/DabovilleReportWidget.php index 3af7eb0d..30f9852f 100644 --- a/app/Filament/Widgets/DabovilleReportWidget.php +++ b/app/Filament/Widgets/DabovilleReportWidget.php @@ -2,8 +2,8 @@ namespace App\Filament\Widgets; -use Filament\Widgets\Widget; use App\Models\Person; +use Filament\Widgets\Widget; class DabovilleReportWidget extends Widget { @@ -31,21 +31,20 @@ private function traverseFamilyTree($person, $currentNumber) { $this->reportData[$person->id] = [ 'number' => $currentNumber, - 'name' => $person->fullname(), - 'birth' => optional($person->birth())->date, - 'death' => optional($person->death())->date, + 'name' => $person->fullname(), + 'birth' => optional($person->birth())->date, + 'death' => optional($person->death())->date, ]; $childNumber = 1; foreach ($person->child_in_family as $child) { - $this->traverseFamilyTree($child, $currentNumber . '.' . $childNumber); + $this->traverseFamilyTree($child, $currentNumber.'.'.$childNumber); $childNumber++; } } - public function render(): \Illuminate\Contracts\View\View - { - return view(static::$view, ['reportData' => $this->reportData, 'selectedPersonId' => $this->selectedPersonId]); - } - + public function render(): \Illuminate\Contracts\View\View + { + return view(static::$view, ['reportData' => $this->reportData, 'selectedPersonId' => $this->selectedPersonId]); + } } diff --git a/app/Filament/Widgets/DescendantChartWidget.php b/app/Filament/Widgets/DescendantChartWidget.php index c5fa8ee3..4926d404 100644 --- a/app/Filament/Widgets/DescendantChartWidget.php +++ b/app/Filament/Widgets/DescendantChartWidget.php @@ -2,8 +2,8 @@ namespace App\Filament\Widgets; -use Filament\Widgets\Widget; use App\Models\Person; +use Filament\Widgets\Widget; class DescendantChartWidget extends Widget { @@ -21,7 +21,7 @@ private function processDescendantData($data) { return array_map(function ($item) { return [ - 'id' => $item['id'], + 'id' => $item['id'], 'name' => $item['name'], ]; }, $data); diff --git a/app/Filament/Widgets/FanChartWidget.php b/app/Filament/Widgets/FanChartWidget.php index 72cfaa15..7ebc38ae 100644 --- a/app/Filament/Widgets/FanChartWidget.php +++ b/app/Filament/Widgets/FanChartWidget.php @@ -2,8 +2,8 @@ namespace App\Filament\Widgets; -use Filament\Widgets\Widget; use App\Models\Person; +use Filament\Widgets\Widget; class FanChartWidget extends Widget { diff --git a/app/Filament/Widgets/PedigreeChartWidget.php b/app/Filament/Widgets/PedigreeChartWidget.php index 4f519616..73bf7112 100644 --- a/app/Filament/Widgets/PedigreeChartWidget.php +++ b/app/Filament/Widgets/PedigreeChartWidget.php @@ -2,8 +2,8 @@ namespace App\Filament\Widgets; -use Filament\Widgets\Widget; use App\Models\Person; +use Filament\Widgets\Widget; class PedigreeChartWidget extends Widget { diff --git a/app/Http/Controllers/ContactController.php b/app/Http/Controllers/ContactController.php index 0795e900..abdd4ca9 100644 --- a/app/Http/Controllers/ContactController.php +++ b/app/Http/Controllers/ContactController.php @@ -2,18 +2,18 @@ namespace App\Http\Controllers; +use App\Mail\ContactMail; use Illuminate\Http\Request; use Illuminate\Support\Facades\Mail; -use App\Mail\ContactMail; class ContactController extends Controller { public function sendEmail(Request $request) { $validatedData = $request->validate([ - 'name' => 'required|string|max:255', - 'email' => 'required|email', - 'message' => 'required|string' + 'name' => 'required|string|max:255', + 'email' => 'required|email', + 'message' => 'required|string', ]); Mail::to(env('CONTACT_EMAIL'))->send(new ContactMail($validatedData)); diff --git a/app/Http/Controllers/FanChartController.php b/app/Http/Controllers/FanChartController.php index 5e1e1f00..50b32892 100644 --- a/app/Http/Controllers/FanChartController.php +++ b/app/Http/Controllers/FanChartController.php @@ -2,8 +2,6 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; - class FanChartController extends Controller { public function show() diff --git a/app/Http/Controllers/PedigreeChartController.php b/app/Http/Controllers/PedigreeChartController.php index 37c6582a..f4bdb9bd 100644 --- a/app/Http/Controllers/PedigreeChartController.php +++ b/app/Http/Controllers/PedigreeChartController.php @@ -2,8 +2,6 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; - class PedigreeChartController extends Controller { public function __construct() diff --git a/app/Http/Livewire/DabovilleReport.php b/app/Http/Livewire/DabovilleReport.php index 1d67811c..8868a5ff 100644 --- a/app/Http/Livewire/DabovilleReport.php +++ b/app/Http/Livewire/DabovilleReport.php @@ -2,16 +2,16 @@ namespace App\Http\Livewire; -use Livewire\Component; -use App\Models\Person; use App\Models\Family; +use App\Models\Person; +use Livewire\Component; /** - * Class DabovilleReport extends Component + * Class DabovilleReport extends Component. * * DabovilleReport - Class for generating a report based on a person's family tree. * - * @var int selectedPersonId The ID of the selected person for the report. + * @var int selectedPersonId The ID of the selected person for the report. * @var array reportData Array to store the report data. */ class DabovilleReport extends Component @@ -19,7 +19,7 @@ class DabovilleReport extends Component public $selectedPersonId; public $reportData = []; - /** + /** * Renders the DabovilleReport component. * * @return view @@ -33,6 +33,7 @@ public function render() * Generates a report based on the provided person ID. * * @param int personId The ID of the person to generate the report for. + * * @return void */ public function generateReport($personId) @@ -45,25 +46,26 @@ public function generateReport($personId) } } - /** + /** * Traverses the family tree starting from the given person. * * @param Person person The person to start the traversal from. * @param string currentNumber The current number in the family tree. + * * @return void */ private function traverseFamilyTree($person, $currentNumber) { $this->reportData[$person->id] = [ 'number' => $currentNumber, - 'name' => $person->fullname(), - 'birth' => optional($person->birth())->date, - 'death' => optional($person->death())->date, + 'name' => $person->fullname(), + 'birth' => optional($person->birth())->date, + 'death' => optional($person->death())->date, ]; $childNumber = 1; foreach ($person->child_in_family as $child) { - $this->traverseFamilyTree($child, $currentNumber . '.' . $childNumber); + $this->traverseFamilyTree($child, $currentNumber.'.'.$childNumber); $childNumber++; } } diff --git a/app/Http/Livewire/DescendantChartComponent.php b/app/Http/Livewire/DescendantChartComponent.php index 702d052f..18cd97b0 100644 --- a/app/Http/Livewire/DescendantChartComponent.php +++ b/app/Http/Livewire/DescendantChartComponent.php @@ -2,14 +2,14 @@ namespace App\Http\Livewire; -use Livewire\Component; use App\Models\Person; +use Livewire\Component; class DescendantChartComponent extends Component { public $descendantsData = []; - /** + /** * Mounts the component and retrieves the descendants data. */ public function mount() @@ -24,7 +24,7 @@ private function processDescendantData($data) // This is a placeholder for the actual data processing logic return array_map(function ($item) { return [ - 'id' => $item['id'], + 'id' => $item['id'], 'name' => $item['name'], // Additional processing as per D3.js requirements ]; diff --git a/app/Http/Livewire/FanChart.php b/app/Http/Livewire/FanChart.php index 0dc04bb5..b83fbea6 100644 --- a/app/Http/Livewire/FanChart.php +++ b/app/Http/Livewire/FanChart.php @@ -2,8 +2,8 @@ namespace App\Http\Livewire; -use Livewire\Component; -use App\Models\Person; // Assuming there's a Person model to fetch genealogical data +use App\Models\Person; +use Livewire\Component; // Assuming there's a Person model to fetch genealogical data class FanChart extends Component { diff --git a/app/Http/Livewire/FanChartComponent.php b/app/Http/Livewire/FanChartComponent.php index 3fbf2a53..eb20e059 100644 --- a/app/Http/Livewire/FanChartComponent.php +++ b/app/Http/Livewire/FanChartComponent.php @@ -2,8 +2,8 @@ namespace App\Http\Livewire; -use Livewire\Component; use App\Models\Person; +use Livewire\Component; class FanChartComponent extends Component { @@ -12,6 +12,7 @@ class FanChartComponent extends Component public function render() { $this->people = Person::all(); + return view('livewire.fan-chart-component', ['people' => $this->people]); } } diff --git a/app/Http/Livewire/PedigreeChart.php b/app/Http/Livewire/PedigreeChart.php index b97f32b6..3d000bb8 100644 --- a/app/Http/Livewire/PedigreeChart.php +++ b/app/Http/Livewire/PedigreeChart.php @@ -2,9 +2,9 @@ namespace App\Http\Livewire; -use Livewire\Component; use App\Models\Person; use Illuminate\Support\Collection; +use Livewire\Component; class PedigreeChart extends Component { @@ -43,9 +43,9 @@ public function pan($direction) protected function getListeners() { return [ - 'zoomIn' => 'zoomIn', + 'zoomIn' => 'zoomIn', 'zoomOut' => 'zoomOut', - 'pan' => 'pan', + 'pan' => 'pan', ]; } } diff --git a/app/Jobs/ExportGedCom.php b/app/Jobs/ExportGedCom.php index d726727a..a632b7ea 100644 --- a/app/Jobs/ExportGedCom.php +++ b/app/Jobs/ExportGedCom.php @@ -47,7 +47,7 @@ public function handle() $families = Family::all(); // Logging the count of people and families to be exported - Log::info("Exporting " . $people->count() . " people and " . $families->count() . " families."); + Log::info('Exporting '.$people->count().' people and '.$families->count().' families.'); // Generating GEDCOM content $writer = new GedcomGenerator($people, $families); @@ -55,7 +55,7 @@ public function handle() // Storing the GEDCOM file $manager->storage()->put($this->file, $content); - Log::info("GEDCOM file generated and stored: " . $this->file); + Log::info('GEDCOM file generated and stored: '.$this->file); $up_nest = 3; $down_nest = 3; @@ -70,14 +70,14 @@ public function handle() // $filePath = $manager->storage()->path($filePath); // chmod_r('/home/genealogia/domains/api.genealogia.co.uk/genealogy/storage/tenants/'); // Setting permissions for the GEDCOM file - exec('chmod 0644 '. $manager->storage()->path($this->file)); - Log::info("Permissions set for GEDCOM file."); - + exec('chmod 0644 '.$manager->storage()->path($this->file)); + Log::info('Permissions set for GEDCOM file.'); + // Handling errors and exceptions try { // Export logic here } catch (\Exception $e) { - Log::error("Error during GEDCOM export: " . $e->getMessage()); + Log::error('Error during GEDCOM export: '.$e->getMessage()); } //exec ("find /home/genealogia/ap -type d -exec chmod 0750 {} +"); //exec ("find /path/to/folder -type f -exec chmod 0644 {} +"); diff --git a/app/Models/Team.php b/app/Models/Team.php index e7b06441..0ec98025 100644 --- a/app/Models/Team.php +++ b/app/Models/Team.php @@ -3,10 +3,9 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; -use App\Models\TeamInvitation; - -class Team extends Model { +class Team extends Model +{ protected $fillable = [ 'id', 'name', @@ -16,5 +15,4 @@ public function invitations() { return $this->hasMany(TeamInvitation::class); } - -} +} diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index 2a47cfb3..77c84f26 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -1,4 +1,5 @@ discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') ->pages([ - Pages\Dashboard::class,]) + Pages\Dashboard::class, ]) ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') ->widgets([ Widgets\AccountWidget::class, @@ -60,11 +54,11 @@ public function panel(Panel $panel): Panel ->tenantRegistration(RegisterTeam::class) ->tenantProfile(EditTeamProfile::class) ->tenant(Team::class) - ->tenantBillingProvider(new BillingProvider('default')) + ->tenantBillingProvider(new BillingProvider('default')) ->requiresTenantSubscription() ->tenantMiddleware([ SyncSpatiePermissionsWithFilamentTenants::class, - ], isPersistent: true) + ], isPersistent: true) ->middleware([ EncryptCookies::class, AddQueuedCookiesToResponse::class, diff --git a/app/Providers/Filament/PublicPanelProvider.php b/app/Providers/Filament/PublicPanelProvider.php index 06ced287..cfb4f489 100644 --- a/app/Providers/Filament/PublicPanelProvider.php +++ b/app/Providers/Filament/PublicPanelProvider.php @@ -2,12 +2,12 @@ namespace App\Providers\Filament; -use Filament\Panel; -use Filament\PanelProvider; -use Filament\Support\Colors\Color; use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\DisableBladeIconComponents; use Filament\Http\Middleware\DispatchServingFilamentEvent; +use Filament\Panel; +use Filament\PanelProvider; +use Filament\Support\Colors\Color; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\EncryptCookies; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; diff --git a/app/Providers/FilamentServiceProvider.php b/app/Providers/FilamentServiceProvider.php index 6738eb7b..106624c6 100644 --- a/app/Providers/FilamentServiceProvider.php +++ b/app/Providers/FilamentServiceProvider.php @@ -2,10 +2,10 @@ namespace App\Providers; +use App\Http\Livewire\AnotherComponent; +use App\Http\Livewire\ExampleComponent; use Filament\Panel; use Illuminate\Support\ServiceProvider; -use App\Http\Livewire\ExampleComponent; -use App\Http\Livewire\AnotherComponent; class FilamentServiceProvider extends ServiceProvider { diff --git a/config/cashier.php b/config/cashier.php index b3e9a65e..ce850a5a 100644 --- a/config/cashier.php +++ b/config/cashier.php @@ -1,13 +1,11 @@ [ - 'default' => [ - 'price_id' => ENV('CASHIER_STRIPE_SUBSCRIPTION_DEFAULT_PRICE_ID'), - 'trial_days' => 14, // Optional - 'collect_tax_ids' => false, // Optional + 'plans' => [ + 'default' => [ + 'price_id' => ENV('CASHIER_STRIPE_SUBSCRIPTION_DEFAULT_PRICE_ID'), + 'trial_days' => 14, // Optional + 'collect_tax_ids' => false, // Optional + ], ], -], ]; diff --git a/config/logging.php b/config/logging.php index 5da81b1a..0b7b737e 100644 --- a/config/logging.php +++ b/config/logging.php @@ -116,7 +116,7 @@ 'emergency' => [ 'path' => storage_path('logs/laravel.log'), - ], + ], 'deprecations' => [ 'driver' => 'daily', @@ -125,6 +125,6 @@ 'days' => 30, ], - ], + ], - ]; +]; diff --git a/config/octane.php b/config/octane.php index 3fa66c2e..f6ad937d 100644 --- a/config/octane.php +++ b/config/octane.php @@ -150,7 +150,7 @@ 'tables' => [ 'example' => [ - 'size' => 1000, + 'size' => 1000, 'columns' => [ 'name' => 'string:1000', 'votes' => 'int', diff --git a/database/migrations/2021_03_11_033800_create_teams.php b/database/migrations/2021_03_11_033800_create_teams.php index 4609d8d8..fb6c34a4 100644 --- a/database/migrations/2021_03_11_033800_create_teams.php +++ b/database/migrations/2021_03_11_033800_create_teams.php @@ -15,7 +15,7 @@ public function up() Schema::create('teams', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name')->nullable(); - + $table->timestamps(); }); } diff --git a/routes/web.php b/routes/web.php index 569c2c4e..ebe6f8c5 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,13 +16,8 @@ Route::get('/', function () { return view('layouts.home'); - - -Route::post('/send-invitation', 'TeamInvitationController@sendInvitation')->name('send.invitation'); -Route::post('/accept-invitation/{token}', 'TeamInvitationController@acceptInvitation')->name('accept.invitation'); - - - + Route::post('/send-invitation', 'TeamInvitationController@sendInvitation')->name('send.invitation'); + Route::post('/accept-invitation/{token}', 'TeamInvitationController@acceptInvitation')->name('accept.invitation'); }); Route::get('/privacy', function () { @@ -34,4 +29,3 @@ Route::get('/contact', function () { return view('contact'); }); Route::post('/contact/send', 'App\Http\Controllers\ContactController@sendEmail'); - diff --git a/tests/Feature/Filament/Resources/GedcomResourceTest.php b/tests/Feature/Filament/Resources/GedcomResourceTest.php index fec84708..4cbbc7e7 100644 --- a/tests/Feature/Filament/Resources/GedcomResourceTest.php +++ b/tests/Feature/Filament/Resources/GedcomResourceTest.php @@ -2,14 +2,13 @@ namespace Tests\Feature\Filament\Resources; -use Tests\TestCase; +use App\Filament\Resources\GedcomResource; use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Support\Facades\Storage; -use App\Jobs\ImportGedcom; use Illuminate\Http\UploadedFile; +use Illuminate\Support\Facades\Storage; use Livewire\Livewire; -use App\Filament\Resources\GedcomResource; +use Tests\TestCase; class GedcomResourceTest extends TestCase { @@ -57,7 +56,7 @@ public function test_file_upload_dispatches_import_gedcom_job() ->set('attachment', $file) ->call('save'); - Storage::disk('private')->assertExists('gedcom-form-imports/' . $file->hashName()); + Storage::disk('private')->assertExists('gedcom-form-imports/'.$file->hashName()); $this->assertDatabaseHas('jobs', ['queue' => 'default']); } } diff --git a/tests/Feature/Filament/Resources/MediaObjectResourceTest.php b/tests/Feature/Filament/Resources/MediaObjectResourceTest.php index cb8e6964..3c80a60e 100644 --- a/tests/Feature/Filament/Resources/MediaObjectResourceTest.php +++ b/tests/Feature/Filament/Resources/MediaObjectResourceTest.php @@ -2,16 +2,16 @@ namespace Tests\Feature\Filament\Resources; -use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; -use App\Models\MediaObject; -use Livewire\Livewire; use App\Filament\Resources\MediaObjectResource; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use Livewire\Livewire; +use Tests\TestCase; class MediaObjectResourceTest extends TestCase { - use RefreshDatabase, WithFaker; + use RefreshDatabase; + use WithFaker; public function test_form_schema_contains_correct_fields() { diff --git a/tests/Feature/Filament/Resources/NoteResourceTest.php b/tests/Feature/Filament/Resources/NoteResourceTest.php index 616602ee..ceb5d6f1 100644 --- a/tests/Feature/Filament/Resources/NoteResourceTest.php +++ b/tests/Feature/Filament/Resources/NoteResourceTest.php @@ -2,10 +2,10 @@ namespace Tests\Feature\Filament\Resources; -use Tests\TestCase; +use App\Filament\Resources\NoteResource; use Illuminate\Foundation\Testing\RefreshDatabase; use Livewire\Livewire; -use App\Filament\Resources\NoteResource; +use Tests\TestCase; class NoteResourceTest extends TestCase { diff --git a/tests/Feature/Filament/Resources/PersonAliaResourceTest.php b/tests/Feature/Filament/Resources/PersonAliaResourceTest.php index d9f942bc..9c5c2acc 100644 --- a/tests/Feature/Filament/Resources/PersonAliaResourceTest.php +++ b/tests/Feature/Filament/Resources/PersonAliaResourceTest.php @@ -2,11 +2,10 @@ namespace Tests\Feature\Filament\Resources; -use Tests\TestCase; +use App\Filament\Resources\PersonAliaResource; use Illuminate\Foundation\Testing\RefreshDatabase; use Livewire\Livewire; -use App\Filament\Resources\PersonAliaResource; -use App\Models\PersonAlia; +use Tests\TestCase; class PersonAliaResourceTest extends TestCase { diff --git a/tests/Feature/Filament/SubmResourceTest.php b/tests/Feature/Filament/SubmResourceTest.php index 9c476ab1..a362839c 100644 --- a/tests/Feature/Filament/SubmResourceTest.php +++ b/tests/Feature/Filament/SubmResourceTest.php @@ -3,9 +3,6 @@ namespace Tests\Feature\Filament; use App\Filament\Resources\SubmResource; -use App\Filament\Resources\SubmResource\Pages\CreateSubm; -use App\Filament\Resources\SubmResource\Pages\EditSubm; -use App\Filament\Resources\SubmResource\Pages\ListSubms; use App\Models\Subm; use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; @@ -30,8 +27,8 @@ public function user_can_create_subm() $this->actingAsUser(); $response = $this->post(route('filament.resources.subms.create'), [ 'group' => 'Test Group', - 'gid' => '123', - 'name' => 'Test Name', + 'gid' => '123', + 'name' => 'Test Name', // Add other fields accordingly ]); $response->assertStatus(302); @@ -52,7 +49,7 @@ public function user_can_edit_subm() ]); $response->assertStatus(302); $this->assertDatabaseHas('subms', [ - 'id' => $subm->id, + 'id' => $subm->id, 'name' => 'Updated Name', // Add other fields accordingly ]); diff --git a/tests/Feature/Filament/SubnResourceTest.php b/tests/Feature/Filament/SubnResourceTest.php index 42da6710..0383d385 100644 --- a/tests/Feature/Filament/SubnResourceTest.php +++ b/tests/Feature/Filament/SubnResourceTest.php @@ -3,9 +3,6 @@ namespace Tests\Feature\Filament; use App\Filament\Resources\SubnResource; -use App\Filament\Resources\SubnResource\Pages\CreateSubn; -use App\Filament\Resources\SubnResource\Pages\EditSubn; -use App\Filament\Resources\SubnResource\Pages\ListSubns; use App\Models\Subn; use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; @@ -33,7 +30,7 @@ public function test_user_can_create_subn() 'ance' => 'Test Ance', 'desc' => 'Test Desc', 'ordi' => 'Test Ordi', - 'rin' => 'Test Rin', + 'rin' => 'Test Rin', ]); $response->assertStatus(302); $this->assertDatabaseHas('subns', [ @@ -53,7 +50,7 @@ public function test_user_can_edit_subn() ]); $response->assertStatus(302); $this->assertDatabaseHas('subns', [ - 'id' => $subn->id, + 'id' => $subn->id, 'subm' => 'Updated Subm', 'famf' => 'Updated Famf', ]); diff --git a/tests/Feature/Filament/TypeResourceTest.php b/tests/Feature/Filament/TypeResourceTest.php index c08caba6..04ec6839 100644 --- a/tests/Feature/Filament/TypeResourceTest.php +++ b/tests/Feature/Filament/TypeResourceTest.php @@ -3,7 +3,6 @@ namespace Tests\Feature\Filament; use App\Filament\Resources\TypeResource; -use App\Filament\Resources\TypeResource\Pages\CreateType; use App\Models\Type; use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; @@ -25,15 +24,15 @@ public function test_user_can_create_type() { $this->actingAsUser(); $response = $this->post(route('filament.resources.types.create'), [ - 'name' => 'Test Type', + 'name' => 'Test Type', 'description' => 'This is a test type description.', - 'is_active' => 1, + 'is_active' => 1, ]); $response->assertRedirect(); $this->assertDatabaseHas('types', [ - 'name' => 'Test Type', + 'name' => 'Test Type', 'description' => 'This is a test type description.', - 'is_active' => 1, + 'is_active' => 1, ]); } @@ -41,9 +40,9 @@ public function test_type_creation_requires_valid_data() { $this->actingAsUser(); $response = $this->post(route('filament.resources.types.create'), [ - 'name' => '', + 'name' => '', 'description' => '', - 'is_active' => 'invalid', + 'is_active' => 'invalid', ]); $response->assertSessionHasErrors(['name', 'description', 'is_active']); } diff --git a/tests/Filament/Resources/AuthorResourceTest.php b/tests/Filament/Resources/AuthorResourceTest.php index bbba592e..0da59955 100644 --- a/tests/Filament/Resources/AuthorResourceTest.php +++ b/tests/Filament/Resources/AuthorResourceTest.php @@ -52,9 +52,9 @@ public function test_table_schema_includes_all_columns_with_correct_configuratio public function test_crud_operations() { $authorData = [ - 'name' => 'John Doe', + 'name' => 'John Doe', 'description' => 'An author', - 'is_active' => 1, + 'is_active' => 1, ]; // Create diff --git a/tests/Filament/Resources/ChanResourceTest.php b/tests/Filament/Resources/ChanResourceTest.php index 3b5c07e8..c2dc692a 100644 --- a/tests/Filament/Resources/ChanResourceTest.php +++ b/tests/Filament/Resources/ChanResourceTest.php @@ -44,9 +44,9 @@ public function test_crud_operations() { $chanData = [ 'group' => 'Test Group', - 'gid' => 123, - 'date' => '2023-01-01', - 'time' => '12:00:00', + 'gid' => 123, + 'date' => '2023-01-01', + 'time' => '12:00:00', ]; // Create diff --git a/tests/Filament/Resources/CitationResourceTest.php b/tests/Filament/Resources/CitationResourceTest.php index dd118b95..2befc450 100644 --- a/tests/Filament/Resources/CitationResourceTest.php +++ b/tests/Filament/Resources/CitationResourceTest.php @@ -51,14 +51,14 @@ public function test_table_schema_includes_all_columns_with_correct_configuratio public function test_crud_operations() { $citationData = [ - 'name' => 'Test Citation', + 'name' => 'Test Citation', 'description' => 'This is a test citation.', - 'date' => now(), - 'is_active' => 1, - 'volume' => 10, - 'page' => 100, - 'confidence' => 5, - 'source_id' => 1, + 'date' => now(), + 'is_active' => 1, + 'volume' => 10, + 'page' => 100, + 'confidence' => 5, + 'source_id' => 1, ]; $citation = Citation::create($citationData); diff --git a/tests/Filament/Resources/DnaMatchingResourceTest.php b/tests/Filament/Resources/DnaMatchingResourceTest.php index a34650e4..c2c71fe4 100644 --- a/tests/Filament/Resources/DnaMatchingResourceTest.php +++ b/tests/Filament/Resources/DnaMatchingResourceTest.php @@ -56,14 +56,14 @@ public function test_table_schema_includes_all_columns_with_correct_configuratio public function test_crud_operations() { $dnaMatchingData = [ - 'user_id' => 1, - 'image' => 'test_image.png', - 'file1' => 'file1.txt', - 'file2' => 'file2.txt', - 'total_shared_cm' => '100', + 'user_id' => 1, + 'image' => 'test_image.png', + 'file1' => 'file1.txt', + 'file2' => 'file2.txt', + 'total_shared_cm' => '100', 'largest_cm_segment' => '50', - 'match_id' => 2, - 'match_name' => 'Test Match', + 'match_id' => 2, + 'match_name' => 'Test Match', ]; $dnaMatching = DnaMatching::create($dnaMatchingData); diff --git a/tests/Filament/Resources/DnaResourceTest.php b/tests/Filament/Resources/DnaResourceTest.php index cbf919e6..1a2e2981 100644 --- a/tests/Filament/Resources/DnaResourceTest.php +++ b/tests/Filament/Resources/DnaResourceTest.php @@ -2,7 +2,6 @@ namespace Tests\Filament\Resources; -use App\Filament\Resources\DnaResource; use App\Jobs\ImportGedcom; use App\Models\Dna; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Filament/Resources/FamilyResourceTest.php b/tests/Filament/Resources/FamilyResourceTest.php index 001de738..250ae013 100644 --- a/tests/Filament/Resources/FamilyResourceTest.php +++ b/tests/Filament/Resources/FamilyResourceTest.php @@ -3,7 +3,6 @@ namespace Tests\Filament\Resources; use App\Filament\Resources\FamilyResource; -use App\Models\Family; use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; @@ -17,13 +16,13 @@ public function test_form_fields_configuration() $expectedFields = [ 'description' => ['type' => 'textarea', 'maxLength' => 65535], - 'is_active' => ['type' => 'numeric'], - 'type_id' => ['type' => 'numeric'], - 'husband_id' => ['type' => 'numeric'], - 'wife_id' => ['type' => 'numeric'], - 'chan' => ['type' => 'text', 'maxLength' => 255], - 'nchi' => ['type' => 'text', 'maxLength' => 255], - 'rin' => ['type' => 'text', 'maxLength' => 255], + 'is_active' => ['type' => 'numeric'], + 'type_id' => ['type' => 'numeric'], + 'husband_id' => ['type' => 'numeric'], + 'wife_id' => ['type' => 'numeric'], + 'chan' => ['type' => 'text', 'maxLength' => 255], + 'nchi' => ['type' => 'text', 'maxLength' => 255], + 'rin' => ['type' => 'text', 'maxLength' => 255], ]; foreach ($expectedFields as $fieldName => $details) { @@ -41,16 +40,16 @@ public function test_table_configuration() $table = FamilyResource::table(Table::make())->getColumns(); $expectedColumns = [ - 'is_active' => ['sortable' => true, 'type' => 'numeric'], - 'type_id' => ['sortable' => true, 'type' => 'numeric'], + 'is_active' => ['sortable' => true, 'type' => 'numeric'], + 'type_id' => ['sortable' => true, 'type' => 'numeric'], 'husband_id' => ['sortable' => true, 'type' => 'numeric'], - 'wife_id' => ['sortable' => true, 'type' => 'numeric'], + 'wife_id' => ['sortable' => true, 'type' => 'numeric'], 'created_at' => ['sortable' => true, 'type' => 'dateTime'], 'updated_at' => ['sortable' => true, 'type' => 'dateTime'], 'deleted_at' => ['sortable' => true, 'type' => 'dateTime'], - 'chan' => ['searchable' => true, 'type' => 'text'], - 'nchi' => ['searchable' => true, 'type' => 'text'], - 'rin' => ['searchable' => true, 'type' => 'text'], + 'chan' => ['searchable' => true, 'type' => 'text'], + 'nchi' => ['searchable' => true, 'type' => 'text'], + 'rin' => ['searchable' => true, 'type' => 'text'], ]; foreach ($expectedColumns as $columnName => $details) { diff --git a/tests/Filament/Resources/FamilySlgsResourceTest.php b/tests/Filament/Resources/FamilySlgsResourceTest.php index 19913c54..adbe30b5 100644 --- a/tests/Filament/Resources/FamilySlgsResourceTest.php +++ b/tests/Filament/Resources/FamilySlgsResourceTest.php @@ -3,10 +3,7 @@ namespace Tests\Filament\Resources; use App\Filament\Resources\FamilySlgsResource; -use App\Models\FamilySlgs; -use Filament\Forms; use Filament\Resources\Form; -use Filament\Tables; use Filament\Resources\Table; use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; @@ -21,10 +18,10 @@ public function test_form_fields_configuration() $expectedFields = [ 'family_id' => ['type' => 'numeric'], - 'stat' => ['type' => 'text', 'maxLength' => 255], - 'date' => ['type' => 'text', 'maxLength' => 255], - 'plac' => ['type' => 'text', 'maxLength' => 255], - 'temp' => ['type' => 'text', 'maxLength' => 255], + 'stat' => ['type' => 'text', 'maxLength' => 255], + 'date' => ['type' => 'text', 'maxLength' => 255], + 'plac' => ['type' => 'text', 'maxLength' => 255], + 'temp' => ['type' => 'text', 'maxLength' => 255], ]; foreach ($expectedFields as $fieldName => $details) { @@ -42,11 +39,11 @@ public function test_table_configuration() $table = FamilySlgsResource::table(Table::make())->getColumns(); $expectedColumns = [ - 'family_id' => ['sortable' => true, 'type' => 'numeric'], - 'stat' => ['searchable' => true, 'type' => 'text'], - 'date' => ['searchable' => true, 'type' => 'text'], - 'plac' => ['searchable' => true, 'type' => 'text'], - 'temp' => ['searchable' => true, 'type' => 'text'], + 'family_id' => ['sortable' => true, 'type' => 'numeric'], + 'stat' => ['searchable' => true, 'type' => 'text'], + 'date' => ['searchable' => true, 'type' => 'text'], + 'plac' => ['searchable' => true, 'type' => 'text'], + 'temp' => ['searchable' => true, 'type' => 'text'], 'created_at' => ['sortable' => true, 'type' => 'dateTime', 'toggleable' => true], 'updated_at' => ['sortable' => true, 'type' => 'dateTime', 'toggleable' => true], ]; diff --git a/tests/Filament/Resources/PersonAnciResourceTest.php b/tests/Filament/Resources/PersonAnciResourceTest.php index 992df55b..53ec56aa 100644 --- a/tests/Filament/Resources/PersonAnciResourceTest.php +++ b/tests/Filament/Resources/PersonAnciResourceTest.php @@ -2,21 +2,22 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; use App\Models\PersonAnci; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use Tests\TestCase; class PersonAnciResourceTest extends TestCase { - use RefreshDatabase, WithFaker; + use RefreshDatabase; + use WithFaker; public function testCreatePersonAnci() { $data = [ 'group' => $this->faker->word, - 'gid' => $this->faker->randomNumber(), - 'anci' => $this->faker->word, + 'gid' => $this->faker->randomNumber(), + 'anci' => $this->faker->word, ]; $response = $this->post(route('filament.resources.person-anci.store'), $data); @@ -41,8 +42,8 @@ public function testUpdatePersonAnci() $updatedData = [ 'group' => 'Updated Group', - 'gid' => $personAnci->gid + 1, - 'anci' => 'Updated Anci', + 'gid' => $personAnci->gid + 1, + 'anci' => 'Updated Anci', ]; $response = $this->put(route('filament.resources.person-anci.update', $personAnci), $updatedData); diff --git a/tests/Filament/Resources/PersonAssoResourceTest.php b/tests/Filament/Resources/PersonAssoResourceTest.php index 7431b7df..66a1d349 100644 --- a/tests/Filament/Resources/PersonAssoResourceTest.php +++ b/tests/Filament/Resources/PersonAssoResourceTest.php @@ -2,22 +2,23 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; use App\Models\PersonAsso; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use Tests\TestCase; class PersonAssoResourceTest extends TestCase { - use RefreshDatabase, WithFaker; + use RefreshDatabase; + use WithFaker; public function testCreatePersonAsso() { $data = [ - 'group' => $this->faker->word, - 'gid' => $this->faker->randomNumber(), - 'indi' => $this->faker->word, - 'rela' => $this->faker->word, + 'group' => $this->faker->word, + 'gid' => $this->faker->randomNumber(), + 'indi' => $this->faker->word, + 'rela' => $this->faker->word, 'import_confirm' => 1, ]; @@ -42,10 +43,10 @@ public function testUpdatePersonAsso() $personAsso = PersonAsso::factory()->create(); $updatedData = [ - 'group' => 'Updated Group', - 'gid' => $personAsso->gid + 1, - 'indi' => 'Updated Indi', - 'rela' => 'Updated Rela', + 'group' => 'Updated Group', + 'gid' => $personAsso->gid + 1, + 'indi' => 'Updated Indi', + 'rela' => 'Updated Rela', 'import_confirm' => 0, ]; diff --git a/tests/Filament/Resources/PersonEventResourceTest.php b/tests/Filament/Resources/PersonEventResourceTest.php index 6b5bec2f..911426b6 100644 --- a/tests/Filament/Resources/PersonEventResourceTest.php +++ b/tests/Filament/Resources/PersonEventResourceTest.php @@ -2,38 +2,39 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; use App\Models\PersonEvent; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use Tests\TestCase; class PersonEventResourceTest extends TestCase { - use RefreshDatabase, WithFaker; + use RefreshDatabase; + use WithFaker; public function testCreatePersonEvent() { $data = [ 'converted_date' => $this->faker->date, - 'year' => $this->faker->year, - 'month' => $this->faker->month, - 'day' => $this->faker->dayOfMonth, - 'type' => $this->faker->word, - 'attr' => $this->faker->sentence, - 'plac' => $this->faker->city, - 'addr_id' => $this->faker->randomNumber(), - 'phon' => $this->faker->phoneNumber, - 'caus' => $this->faker->sentence, - 'age' => $this->faker->randomDigitNotNull, - 'agnc' => $this->faker->company, - 'adop' => $this->faker->word, - 'adop_famc' => $this->faker->word, - 'birt_famc' => $this->faker->word, - 'person_id' => $this->faker->randomNumber(), - 'title' => $this->faker->sentence, - 'date' => $this->faker->date, - 'description' => $this->faker->sentence, - 'places_id' => $this->faker->randomNumber(), + 'year' => $this->faker->year, + 'month' => $this->faker->month, + 'day' => $this->faker->dayOfMonth, + 'type' => $this->faker->word, + 'attr' => $this->faker->sentence, + 'plac' => $this->faker->city, + 'addr_id' => $this->faker->randomNumber(), + 'phon' => $this->faker->phoneNumber, + 'caus' => $this->faker->sentence, + 'age' => $this->faker->randomDigitNotNull, + 'agnc' => $this->faker->company, + 'adop' => $this->faker->word, + 'adop_famc' => $this->faker->word, + 'birt_famc' => $this->faker->word, + 'person_id' => $this->faker->randomNumber(), + 'title' => $this->faker->sentence, + 'date' => $this->faker->date, + 'description' => $this->faker->sentence, + 'places_id' => $this->faker->randomNumber(), ]; $response = $this->post(route('filament.resources.person-events.store'), $data); diff --git a/tests/Filament/Resources/PersonLdsResourceTest.php b/tests/Filament/Resources/PersonLdsResourceTest.php index cd31a046..4c4c71bf 100644 --- a/tests/Filament/Resources/PersonLdsResourceTest.php +++ b/tests/Filament/Resources/PersonLdsResourceTest.php @@ -2,25 +2,26 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; use App\Models\PersonLds; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use Tests\TestCase; class PersonLdsResourceTest extends TestCase { - use RefreshDatabase, WithFaker; + use RefreshDatabase; + use WithFaker; public function testCreatePersonLds() { $data = [ - 'group' => $this->faker->word, - 'gid' => $this->faker->randomNumber(), - 'type' => $this->faker->word, - 'stat' => $this->faker->word, - 'date' => $this->faker->date, - 'plac' => $this->faker->city, - 'temp' => $this->faker->word, + 'group' => $this->faker->word, + 'gid' => $this->faker->randomNumber(), + 'type' => $this->faker->word, + 'stat' => $this->faker->word, + 'date' => $this->faker->date, + 'plac' => $this->faker->city, + 'temp' => $this->faker->word, 'slac_famc' => $this->faker->word, ]; @@ -46,7 +47,7 @@ public function testUpdatePersonLds() $updatedData = [ 'group' => 'Updated Group', - 'type' => 'Updated Type', + 'type' => 'Updated Type', ]; $response = $this->put(route('filament.resources.person-lds.update', $personLds), $updatedData); diff --git a/tests/Filament/Resources/PersonNameFoneResourceTest.php b/tests/Filament/Resources/PersonNameFoneResourceTest.php index 5d882f9a..645e7091 100644 --- a/tests/Filament/Resources/PersonNameFoneResourceTest.php +++ b/tests/Filament/Resources/PersonNameFoneResourceTest.php @@ -2,12 +2,12 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; -use App\Models\PersonNameFone; use App\Filament\Resources\PersonNameFoneResource; -use Illuminate\Foundation\Testing\RefreshDatabase; +use App\Models\PersonNameFone; use Filament\Forms\Components\TextInput; use Filament\Tables\Columns\TextColumn; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class PersonNameFoneResourceTest extends TestCase { diff --git a/tests/Filament/Resources/PersonNameResourceTest.php b/tests/Filament/Resources/PersonNameResourceTest.php index e62edf89..2c448a19 100644 --- a/tests/Filament/Resources/PersonNameResourceTest.php +++ b/tests/Filament/Resources/PersonNameResourceTest.php @@ -2,14 +2,14 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; -use App\Models\PersonName; use App\Filament\Resources\PersonNameResource; -use Illuminate\Foundation\Testing\RefreshDatabase; +use App\Models\PersonName; use Filament\Forms\Components\TextInput; -use Filament\Tables\Columns\TextColumn; use Filament\Forms\Form; +use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class PersonNameResourceTest extends TestCase { @@ -46,16 +46,16 @@ public function test_table_columns_are_correct() foreach ($table as $index => $column) { $this->assertInstanceOf(TextColumn::class, $column); $expectedName = match ($index) { - 0 => 'group', - 1 => 'gid', - 2 => 'name', - 3 => 'type', - 4 => 'npfx', - 5 => 'givn', - 6 => 'nick', - 7 => 'spfx', - 8 => 'surn', - 9 => 'nsfx', + 0 => 'group', + 1 => 'gid', + 2 => 'name', + 3 => 'type', + 4 => 'npfx', + 5 => 'givn', + 6 => 'nick', + 7 => 'spfx', + 8 => 'surn', + 9 => 'nsfx', 10 => 'created_at', 11 => 'updated_at', }; diff --git a/tests/Filament/Resources/PersonNameRomnResourceTest.php b/tests/Filament/Resources/PersonNameRomnResourceTest.php index ac844f33..3ad43bc8 100644 --- a/tests/Filament/Resources/PersonNameRomnResourceTest.php +++ b/tests/Filament/Resources/PersonNameRomnResourceTest.php @@ -2,14 +2,14 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; -use App\Models\PersonNameRomn; use App\Filament\Resources\PersonNameRomnResource; -use Illuminate\Foundation\Testing\RefreshDatabase; +use App\Models\PersonNameRomn; use Filament\Forms\Components\TextInput; -use Filament\Tables\Columns\TextColumn; use Filament\Forms\Form; +use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class PersonNameRomnResourceTest extends TestCase { @@ -46,16 +46,16 @@ public function test_table_columns_are_correct() foreach ($table as $index => $column) { $this->assertInstanceOf(TextColumn::class, $column); $expectedName = match ($index) { - 0 => 'group', - 1 => 'gid', - 2 => 'name', - 3 => 'type', - 4 => 'npfx', - 5 => 'givn', - 6 => 'nick', - 7 => 'spfx', - 8 => 'surn', - 9 => 'nsfx', + 0 => 'group', + 1 => 'gid', + 2 => 'name', + 3 => 'type', + 4 => 'npfx', + 5 => 'givn', + 6 => 'nick', + 7 => 'spfx', + 8 => 'surn', + 9 => 'nsfx', 10 => 'created_at', 11 => 'updated_at', }; diff --git a/tests/Filament/Resources/PersonResourceTest.php b/tests/Filament/Resources/PersonResourceTest.php index 950f2c91..a8f946f2 100644 --- a/tests/Filament/Resources/PersonResourceTest.php +++ b/tests/Filament/Resources/PersonResourceTest.php @@ -2,13 +2,12 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; -use App\Models\Person; use App\Filament\Resources\PersonResource; -use Illuminate\Foundation\Testing\RefreshDatabase; +use App\Models\Person; use Filament\Forms\Components\Select; use Filament\Tables\Actions\DeleteBulkAction; -use Filament\Tables\Filters\Filter; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class PersonResourceTest extends TestCase { diff --git a/tests/Filament/Resources/RepositoryResourceTest.php b/tests/Filament/Resources/RepositoryResourceTest.php index 4d998e27..762b35e9 100644 --- a/tests/Filament/Resources/RepositoryResourceTest.php +++ b/tests/Filament/Resources/RepositoryResourceTest.php @@ -5,10 +5,6 @@ use App\Filament\Resources\RepositoryResource; use App\Models\Repository; use Tests\TestCase; -use Filament\Forms\Components\TextInput; -use Filament\Forms\Components\Textarea; -use Filament\Forms\Components\DateTimePicker; -use Filament\Tables\Columns\TextColumn; class RepositoryResourceTest extends TestCase { @@ -18,7 +14,7 @@ public function test_form_schema_is_correct() $schema = collect($form->getSchema()); $expectedFields = [ - 'group', 'gid', 'name', 'description', 'date', 'is_active', 'type_id', 'repo', 'addr_id', 'rin', 'phon', 'email', 'fax', 'www' + 'group', 'gid', 'name', 'description', 'date', 'is_active', 'type_id', 'repo', 'addr_id', 'rin', 'phon', 'email', 'fax', 'www', ]; foreach ($expectedFields as $field) { @@ -32,7 +28,7 @@ public function test_table_columns_are_correct() $columns = collect($table->getColumns()); $expectedColumns = [ - 'group', 'gid', 'name', 'date', 'is_active', 'type_id', 'repo', 'addr_id', 'rin', 'phon', 'email', 'fax', 'www', 'created_at', 'updated_at' + 'group', 'gid', 'name', 'date', 'is_active', 'type_id', 'repo', 'addr_id', 'rin', 'phon', 'email', 'fax', 'www', 'created_at', 'updated_at', ]; foreach ($expectedColumns as $column) { diff --git a/tests/Filament/Resources/SourceDataEvenResourceTest.php b/tests/Filament/Resources/SourceDataEvenResourceTest.php index 0fd15b04..5091c078 100644 --- a/tests/Filament/Resources/SourceDataEvenResourceTest.php +++ b/tests/Filament/Resources/SourceDataEvenResourceTest.php @@ -4,8 +4,8 @@ use App\Filament\Resources\SourceDataEvenResource; use App\Models\SourceDataEven; -use Tests\TestCase; use Filament\Forms\Components\TextInput; +use Tests\TestCase; class SourceDataEvenResourceTest extends TestCase { @@ -37,7 +37,7 @@ public function test_table_columns_are_correct() $columns = collect($table->getColumns()); $expectedColumns = [ - 'group', 'gid', 'date', 'plac', 'created_at', 'updated_at' + 'group', 'gid', 'date', 'plac', 'created_at', 'updated_at', ]; foreach ($expectedColumns as $column) { diff --git a/tests/Filament/Resources/SourceDataResourceTest.php b/tests/Filament/Resources/SourceDataResourceTest.php index fe1a19c3..33bbb838 100644 --- a/tests/Filament/Resources/SourceDataResourceTest.php +++ b/tests/Filament/Resources/SourceDataResourceTest.php @@ -4,8 +4,8 @@ use App\Filament\Resources\SourceDataResource; use App\Models\SourceData; -use Tests\TestCase; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class SourceDataResourceTest extends TestCase { @@ -40,7 +40,7 @@ public function test_table_columns_are_correct() $columns = collect($table->getColumns()); $expectedColumns = [ - 'group', 'gid', 'date', 'text', 'agnc', 'created_at', 'updated_at' + 'group', 'gid', 'date', 'text', 'agnc', 'created_at', 'updated_at', ]; foreach ($expectedColumns as $column) { diff --git a/tests/Filament/Resources/SourceRefEvenResourceTest.php b/tests/Filament/Resources/SourceRefEvenResourceTest.php index 9eddc040..8cc2502c 100644 --- a/tests/Filament/Resources/SourceRefEvenResourceTest.php +++ b/tests/Filament/Resources/SourceRefEvenResourceTest.php @@ -15,9 +15,9 @@ public function test_form_schema_is_correct() $expectedFields = [ 'group' => ['maxLength' => 255], - 'gid' => ['numeric' => true], - 'even' => ['maxLength' => 255], - 'role' => ['maxLength' => 255], + 'gid' => ['numeric' => true], + 'even' => ['maxLength' => 255], + 'role' => ['maxLength' => 255], ]; foreach ($expectedFields as $fieldName => $attributes) { diff --git a/tests/Filament/Resources/SourceRefResourceTest.php b/tests/Filament/Resources/SourceRefResourceTest.php index d34e8a4c..0db49abb 100644 --- a/tests/Filament/Resources/SourceRefResourceTest.php +++ b/tests/Filament/Resources/SourceRefResourceTest.php @@ -2,11 +2,10 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; use App\Filament\Resources\SourceRefResource; use Filament\Forms\Components\TextInput; -use Filament\Tables\Columns\TextColumn; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class SourceRefResourceTest extends TestCase { diff --git a/tests/Filament/Resources/SourceRepoResourceTest.php b/tests/Filament/Resources/SourceRepoResourceTest.php index 00b723ec..573f0a92 100644 --- a/tests/Filament/Resources/SourceRepoResourceTest.php +++ b/tests/Filament/Resources/SourceRepoResourceTest.php @@ -2,14 +2,13 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; use App\Filament\Resources\SourceRepoResource; use Filament\Forms; -use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Textarea; +use Filament\Forms\Components\TextInput; use Filament\Tables; -use Filament\Tables\Columns\TextColumn; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class SourceRepoResourceTest extends TestCase { diff --git a/tests/Filament/Resources/SourceResourceTest.php b/tests/Filament/Resources/SourceResourceTest.php index 87d22d6b..533788cf 100644 --- a/tests/Filament/Resources/SourceResourceTest.php +++ b/tests/Filament/Resources/SourceResourceTest.php @@ -2,12 +2,11 @@ namespace Tests\Filament\Resources; -use Tests\TestCase; use App\Filament\Resources\SourceResource; -use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Textarea; -use Filament\Tables\Columns\TextColumn; +use Filament\Forms\Components\TextInput; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class SourceResourceTest extends TestCase { @@ -18,26 +17,26 @@ public function test_form_schema_contains_all_fields_with_correct_configurations $form = SourceResource::form(app(\Filament\Forms\Form::class)); $fields = [ - 'name' => TextInput::class, - 'description' => Textarea::class, - 'date' => TextInput::class, - 'is_active' => TextInput::class, - 'author_id' => TextInput::class, - 'repository_id' => TextInput::class, + 'name' => TextInput::class, + 'description' => Textarea::class, + 'date' => TextInput::class, + 'is_active' => TextInput::class, + 'author_id' => TextInput::class, + 'repository_id' => TextInput::class, 'publication_id' => TextInput::class, - 'type_id' => TextInput::class, - 'sour' => TextInput::class, - 'titl' => Textarea::class, - 'auth' => TextInput::class, - 'data' => TextInput::class, - 'text' => Textarea::class, - 'publ' => Textarea::class, - 'abbr' => TextInput::class, - 'group' => TextInput::class, - 'gid' => TextInput::class, - 'quay' => TextInput::class, - 'rin' => TextInput::class, - 'note' => TextInput::class, + 'type_id' => TextInput::class, + 'sour' => TextInput::class, + 'titl' => Textarea::class, + 'auth' => TextInput::class, + 'data' => TextInput::class, + 'text' => Textarea::class, + 'publ' => Textarea::class, + 'abbr' => TextInput::class, + 'group' => TextInput::class, + 'gid' => TextInput::class, + 'quay' => TextInput::class, + 'rin' => TextInput::class, + 'note' => TextInput::class, ]; foreach ($fields as $fieldName => $fieldType) { @@ -51,7 +50,7 @@ public function test_table_configuration_defines_all_columns_correctly() $table = SourceResource::table(app(\Filament\Tables\Table::class)); $columns = [ - 'name', 'date', 'is_active', 'author_id', 'repository_id', 'publication_id', 'type_id', 'sour', 'auth', 'data', 'abbr', 'group', 'gid', 'quay', 'rin', 'note', 'created_at', 'updated_at' + 'name', 'date', 'is_active', 'author_id', 'repository_id', 'publication_id', 'type_id', 'sour', 'auth', 'data', 'abbr', 'group', 'gid', 'quay', 'rin', 'note', 'created_at', 'updated_at', ]; foreach ($columns as $columnName) { diff --git a/tests/Unit/Filament/Resources/AddrResourceTest.php b/tests/Unit/Filament/Resources/AddrResourceTest.php index 6c606f1f..fd8310ec 100644 --- a/tests/Unit/Filament/Resources/AddrResourceTest.php +++ b/tests/Unit/Filament/Resources/AddrResourceTest.php @@ -2,12 +2,12 @@ namespace Tests\Unit\Filament\Resources; -use PHPUnit\Framework\TestCase; use App\Filament\Resources\AddrResource; use Filament\Forms\Components\TextInput; -use Filament\Tables\Columns\TextColumn; -use Filament\Tables\Actions\EditAction; use Filament\Tables\Actions\DeleteBulkAction; +use Filament\Tables\Actions\EditAction; +use Filament\Tables\Columns\TextColumn; +use PHPUnit\Framework\TestCase; class AddrResourceTest extends TestCase { @@ -48,11 +48,11 @@ public function test_table_configuration_includes_correct_columns_and_actions(): } $editAction = collect($actions)->firstWhere('name', 'edit'); - $this->assertNotNull($editAction, "Edit action does not exist."); - $this->assertInstanceOf(EditAction::class, $editAction, "Edit action is not of type EditAction."); + $this->assertNotNull($editAction, 'Edit action does not exist.'); + $this->assertInstanceOf(EditAction::class, $editAction, 'Edit action is not of type EditAction.'); $deleteBulkAction = collect($bulkActions)->firstWhere('name', 'delete'); - $this->assertNotNull($deleteBulkAction, "Delete bulk action does not exist."); - $this->assertInstanceOf(DeleteBulkAction::class, $deleteBulkAction, "Delete bulk action is not of type DeleteBulkAction."); + $this->assertNotNull($deleteBulkAction, 'Delete bulk action does not exist.'); + $this->assertInstanceOf(DeleteBulkAction::class, $deleteBulkAction, 'Delete bulk action is not of type DeleteBulkAction.'); } } diff --git a/tests/Unit/Filament/Resources/AuthorResourceTest.php b/tests/Unit/Filament/Resources/AuthorResourceTest.php index f988cf7e..c9f60189 100644 --- a/tests/Unit/Filament/Resources/AuthorResourceTest.php +++ b/tests/Unit/Filament/Resources/AuthorResourceTest.php @@ -2,12 +2,12 @@ namespace Tests\Unit\Filament\Resources; -use PHPUnit\Framework\TestCase; use App\Filament\Resources\AuthorResource; use Filament\Forms\Components\TextInput; -use Filament\Tables\Columns\TextColumn; -use Filament\Tables\Actions\EditAction; use Filament\Tables\Actions\DeleteBulkAction; +use Filament\Tables\Actions\EditAction; +use Filament\Tables\Columns\TextColumn; +use PHPUnit\Framework\TestCase; class AuthorResourceTest extends TestCase { @@ -17,9 +17,9 @@ public function test_form_schema_contains_expected_fields(): void $schema = $form->getSchema(); $expectedFields = [ - 'name' => ['type' => TextInput::class, 'required' => true, 'maxLength' => 255], + 'name' => ['type' => TextInput::class, 'required' => true, 'maxLength' => 255], 'description' => ['type' => TextInput::class, 'required' => true, 'maxLength' => 255], - 'is_active' => ['type' => TextInput::class, 'required' => true, 'numeric' => true], + 'is_active' => ['type' => TextInput::class, 'required' => true, 'numeric' => true], ]; foreach ($expectedFields as $fieldName => $fieldAttributes) { @@ -47,11 +47,11 @@ public function test_table_configuration_includes_correct_columns_and_actions(): } $editAction = collect($actions)->firstWhere('name', 'edit'); - $this->assertNotNull($editAction, "Edit action does not exist."); - $this->assertInstanceOf(EditAction::class, $editAction, "Edit action is not of type EditAction."); + $this->assertNotNull($editAction, 'Edit action does not exist.'); + $this->assertInstanceOf(EditAction::class, $editAction, 'Edit action is not of type EditAction.'); $deleteBulkAction = collect($bulkActions)->firstWhere('name', 'delete'); - $this->assertNotNull($deleteBulkAction, "Delete bulk action does not exist."); - $this->assertInstanceOf(DeleteBulkAction::class, $deleteBulkAction, "Delete bulk action is not of type DeleteBulkAction."); + $this->assertNotNull($deleteBulkAction, 'Delete bulk action does not exist.'); + $this->assertInstanceOf(DeleteBulkAction::class, $deleteBulkAction, 'Delete bulk action is not of type DeleteBulkAction.'); } } diff --git a/tests/Unit/Filament/Resources/ChanResourceTest.php b/tests/Unit/Filament/Resources/ChanResourceTest.php index ae5660a9..bc70c219 100644 --- a/tests/Unit/Filament/Resources/ChanResourceTest.php +++ b/tests/Unit/Filament/Resources/ChanResourceTest.php @@ -2,12 +2,12 @@ namespace Tests\Unit\Filament\Resources; -use PHPUnit\Framework\TestCase; use App\Filament\Resources\ChanResource; use Filament\Forms\Components\TextInput; -use Filament\Tables\Columns\TextColumn; -use Filament\Tables\Actions\EditAction; use Filament\Tables\Actions\DeleteBulkAction; +use Filament\Tables\Actions\EditAction; +use Filament\Tables\Columns\TextColumn; +use PHPUnit\Framework\TestCase; class ChanResourceTest extends TestCase { @@ -18,9 +18,9 @@ public function test_form_schema_contains_expected_fields(): void $expectedFields = [ 'group' => TextInput::class, - 'gid' => TextInput::class, - 'date' => TextInput::class, - 'time' => TextInput::class, + 'gid' => TextInput::class, + 'date' => TextInput::class, + 'time' => TextInput::class, ]; foreach ($expectedFields as $fieldName => $fieldClass) { @@ -48,11 +48,11 @@ public function test_table_configuration_includes_correct_columns_and_actions(): } $editAction = collect($actions)->firstWhere('name', 'edit'); - $this->assertNotNull($editAction, "Edit action does not exist."); - $this->assertInstanceOf(EditAction::class, $editAction, "Edit action is not of type EditAction."); + $this->assertNotNull($editAction, 'Edit action does not exist.'); + $this->assertInstanceOf(EditAction::class, $editAction, 'Edit action is not of type EditAction.'); $deleteBulkAction = collect($bulkActions)->firstWhere('name', 'delete'); - $this->assertNotNull($deleteBulkAction, "Delete bulk action does not exist."); - $this->assertInstanceOf(DeleteBulkAction::class, $deleteBulkAction, "Delete bulk action is not of type DeleteBulkAction."); + $this->assertNotNull($deleteBulkAction, 'Delete bulk action does not exist.'); + $this->assertInstanceOf(DeleteBulkAction::class, $deleteBulkAction, 'Delete bulk action is not of type DeleteBulkAction.'); } }