diff --git a/src/Actions/GetCompany.php b/src/Actions/GetCompany.php index 963d13a..b5ef5a1 100644 --- a/src/Actions/GetCompany.php +++ b/src/Actions/GetCompany.php @@ -2,9 +2,9 @@ namespace AdminKit\Companies\Actions; -use Spatie\LaravelData\Data; use AdminKit\Companies\Models\Company; use AdminKit\Companies\UI\API\DTO\CompanyDTO; +use Spatie\LaravelData\Data; class GetCompany { diff --git a/src/Models/Company.php b/src/Models/Company.php index ebf41d6..32c3773 100644 --- a/src/Models/Company.php +++ b/src/Models/Company.php @@ -2,29 +2,26 @@ namespace AdminKit\Companies\Models; -use Spatie\MediaLibrary\HasMedia; -use Illuminate\Support\Collection; -use Spatie\Translatable\HasTranslations; -use Spatie\MediaLibrary\InteractsWithMedia; +use AdminKit\Companies\Database\Factories\CompanyFactory; use AdminKit\Core\Abstracts\Models\AbstractModel; use Illuminate\Database\Eloquent\Casts\Attribute; -use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Factories\HasFactory; -use AdminKit\Companies\Database\Factories\CompanyFactory; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Support\Collection; +use Spatie\MediaLibrary\HasMedia; +use Spatie\MediaLibrary\InteractsWithMedia; +use Spatie\Translatable\HasTranslations; /** * @property-read string $title * @property-read string $text * @property-read string $background - * * @property-read string $history_title * @property-read string $history_text - * * @property-read string $mission_title * @property-read string $mission_text * @property-read Collection $mission_attachments * @property-read string $mission_background - * * @property-read History[] $histories * @property-read Manager[] $managers */ diff --git a/src/Models/History.php b/src/Models/History.php index 959433c..963cf2b 100644 --- a/src/Models/History.php +++ b/src/Models/History.php @@ -2,9 +2,9 @@ namespace AdminKit\Companies\Models; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Spatie\Translatable\HasTranslations; -use Illuminate\Database\Eloquent\Factories\HasFactory; /** * @property-read int $company_id diff --git a/src/Models/Manager.php b/src/Models/Manager.php index 8278398..a9135b2 100644 --- a/src/Models/Manager.php +++ b/src/Models/Manager.php @@ -2,12 +2,12 @@ namespace AdminKit\Companies\Models; -use Spatie\MediaLibrary\HasMedia; -use Illuminate\Database\Eloquent\Model; -use Spatie\Translatable\HasTranslations; -use Spatie\MediaLibrary\InteractsWithMedia; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Model; +use Spatie\MediaLibrary\HasMedia; +use Spatie\MediaLibrary\InteractsWithMedia; +use Spatie\Translatable\HasTranslations; /** * @property-read int $company_id diff --git a/src/UI/API/DTO/CompanyDTO.php b/src/UI/API/DTO/CompanyDTO.php index cecf6b0..9d2f434 100644 --- a/src/UI/API/DTO/CompanyDTO.php +++ b/src/UI/API/DTO/CompanyDTO.php @@ -2,33 +2,32 @@ namespace AdminKit\Companies\UI\API\DTO; -use Spatie\LaravelData\Data; -use Illuminate\Support\Collection; use AdminKit\Companies\Models\Company; -use Spatie\LaravelData\DataCollection; +use Illuminate\Support\Collection; use Spatie\LaravelData\Attributes\DataCollectionOf; +use Spatie\LaravelData\Data; +use Spatie\LaravelData\DataCollection; class CompanyDTO extends Data { public function __construct( - public string $title, - public string $text, - public ?string $background, + public string $title, + public string $text, + public ?string $background, - public ?string $history_title, - public ?string $history_text, + public ?string $history_title, + public ?string $history_text, #[DataCollectionOf(HistoryDTO::class)] public DataCollection $history_years, - public ?string $mission_title, - public ?string $mission_text, - public ?Collection $mission_attachments, - public ?string $mission_background, + public ?string $mission_title, + public ?string $mission_text, + public ?Collection $mission_attachments, + public ?string $mission_background, #[DataCollectionOf(ManagerDTO::class)] public DataCollection $management, - ) - { + ) { } public static function fromModel(Company $company): CompanyDTO diff --git a/src/UI/API/DTO/HistoryDTO.php b/src/UI/API/DTO/HistoryDTO.php index 25114a5..23c4cd3 100644 --- a/src/UI/API/DTO/HistoryDTO.php +++ b/src/UI/API/DTO/HistoryDTO.php @@ -2,16 +2,15 @@ namespace AdminKit\Companies\UI\API\DTO; -use Spatie\LaravelData\Data; use AdminKit\Companies\Models\History; +use Spatie\LaravelData\Data; class HistoryDTO extends Data { public function __construct( public string $title, public string $text, - ) - { + ) { } public static function fromModel(History $history): HistoryDTO diff --git a/src/UI/API/DTO/ManagerDTO.php b/src/UI/API/DTO/ManagerDTO.php index 9f501f2..bd95ee9 100644 --- a/src/UI/API/DTO/ManagerDTO.php +++ b/src/UI/API/DTO/ManagerDTO.php @@ -2,9 +2,8 @@ namespace AdminKit\Companies\UI\API\DTO; -use Spatie\LaravelData\Data; -use AdminKit\Companies\Models\History; use AdminKit\Companies\Models\Manager; +use Spatie\LaravelData\Data; class ManagerDTO extends Data { @@ -13,8 +12,7 @@ public function __construct( public string $bio, public string $text, public string $photo, - ) - { + ) { } public static function fromModel(Manager $manager): ManagerDTO diff --git a/src/UI/Filament/Resources/CompanyResource.php b/src/UI/Filament/Resources/CompanyResource.php index eba1fe1..7a238d8 100644 --- a/src/UI/Filament/Resources/CompanyResource.php +++ b/src/UI/Filament/Resources/CompanyResource.php @@ -2,15 +2,15 @@ namespace AdminKit\Companies\UI\Filament\Resources; -use Filament\Forms; -use Filament\Tables; -use Filament\Resources\Resource; use AdminKit\Companies\Models\Company; -use Filament\Forms\Components\Tabs\Tab; -use AdminKit\Core\Forms\Components\TranslatableTabs; -use Filament\Forms\Components\SpatieMediaLibraryFileUpload; use AdminKit\Companies\UI\Filament\Resources\CompanyResource\Pages; use AdminKit\Companies\UI\Filament\Resources\CompanyResource\RelationManagers; +use AdminKit\Core\Forms\Components\TranslatableTabs; +use Filament\Forms; +use Filament\Forms\Components\SpatieMediaLibraryFileUpload; +use Filament\Forms\Components\Tabs\Tab; +use Filament\Resources\Resource; +use Filament\Tables; class CompanyResource extends Resource { diff --git a/src/UI/Filament/Resources/CompanyResource/RelationManagers/HistoriesRelationManager.php b/src/UI/Filament/Resources/CompanyResource/RelationManagers/HistoriesRelationManager.php index 16f2f45..41588c6 100644 --- a/src/UI/Filament/Resources/CompanyResource/RelationManagers/HistoriesRelationManager.php +++ b/src/UI/Filament/Resources/CompanyResource/RelationManagers/HistoriesRelationManager.php @@ -2,12 +2,12 @@ namespace AdminKit\Companies\UI\Filament\Resources\CompanyResource\RelationManagers; +use AdminKit\Core\Forms\Components\TranslatableTabs; use Filament\Forms; -use Filament\Tables; use Filament\Forms\Components\Tabs\Tab; -use Illuminate\Database\Eloquent\Model; -use AdminKit\Core\Forms\Components\TranslatableTabs; use Filament\Resources\RelationManagers\RelationManager; +use Filament\Tables; +use Illuminate\Database\Eloquent\Model; class HistoriesRelationManager extends RelationManager { diff --git a/src/UI/Filament/Resources/CompanyResource/RelationManagers/ManagersRelationManager.php b/src/UI/Filament/Resources/CompanyResource/RelationManagers/ManagersRelationManager.php index 833df95..f12ab82 100644 --- a/src/UI/Filament/Resources/CompanyResource/RelationManagers/ManagersRelationManager.php +++ b/src/UI/Filament/Resources/CompanyResource/RelationManagers/ManagersRelationManager.php @@ -2,12 +2,12 @@ namespace AdminKit\Companies\UI\Filament\Resources\CompanyResource\RelationManagers; +use AdminKit\Core\Forms\Components\TranslatableTabs; use Filament\Forms; -use Filament\Tables; use Filament\Forms\Components\Tabs\Tab; -use Illuminate\Database\Eloquent\Model; -use AdminKit\Core\Forms\Components\TranslatableTabs; use Filament\Resources\RelationManagers\RelationManager; +use Filament\Tables; +use Illuminate\Database\Eloquent\Model; class ManagersRelationManager extends RelationManager {