Skip to content

Commit

Permalink
Merge branch '3.x' of my.github.com:IBEC-BOX/admin-kit-companies into…
Browse files Browse the repository at this point in the history
… 3.x
  • Loading branch information
daurensky committed Mar 10, 2024
2 parents ac647b0 + 5d74323 commit 1d4cf2c
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/Actions/GetCompany.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
15 changes: 6 additions & 9 deletions src/Models/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Models/History.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Models/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 13 additions & 14 deletions src/UI/API/DTO/CompanyDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/UI/API/DTO/HistoryDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/UI/API/DTO/ManagerDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -13,8 +12,7 @@ public function __construct(
public string $bio,
public string $text,
public string $photo,
)
{
) {
}

public static function fromModel(Manager $manager): ManagerDTO
Expand Down
12 changes: 6 additions & 6 deletions src/UI/Filament/Resources/CompanyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 1d4cf2c

Please sign in to comment.