Skip to content

Commit

Permalink
Update api models and move ApiFactory to foundation [WEB-2996]
Browse files Browse the repository at this point in the history
  • Loading branch information
zachgarwood committed Jan 14, 2025
1 parent 4ca0ddb commit d2a4634
Show file tree
Hide file tree
Showing 26 changed files with 45 additions and 1,910 deletions.
1,165 changes: 0 additions & 1,165 deletions app/Libraries/Api/Models/BaseApiModel.php

This file was deleted.

4 changes: 2 additions & 2 deletions app/Models/Api/Artist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use App\Helpers\StringHelpers;

class Artist extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/artists',
'resource' => '/api/v1/artists/{id}',
'search' => '/api/v1/artists/search'
Expand Down
6 changes: 3 additions & 3 deletions app/Models/Api/Artwork.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Builders\ApiModelBuilder;
use App\Models\Behaviors\HasMediasApi;
use App\Models\Behaviors\HasFeaturedRelated;
use App\Helpers\DateHelpers;
use App\Helpers\ImageHelpers;
use App\Helpers\StringHelpers;
use Database\Factories\Api\HasApiFactory;
use Aic\Hub\Foundation\Library\Api\Models\Behaviors\HasApiFactory;

class Artwork extends BaseApiModel
{
Expand All @@ -29,7 +29,7 @@ class Artwork extends BaseApiModel

protected $showDefaultRelatedItems = true;

protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/artworks',
'resource' => '/api/v1/artworks/{id}',
'search' => '/api/v1/artworks/search',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/ArtworkType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class ArtworkType extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/artwork-types',
'resource' => '/api/v1/artwork-types/{id}',
'search' => '/api/v1/artwork-types/search',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Builders\ApiModelBuilder;
use App\Models\Behaviors\HasMediasApi;
use App\Helpers\ImageHelpers;
Expand All @@ -16,7 +16,7 @@ class Asset extends BaseApiModel
imageFront as public imageDams;
}

protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/assets',
'resource' => '/api/v1/assets/{id}',
'search' => '/api/v1/assets/search',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class Category extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/categories',
'resource' => '/api/v1/categories/{id}',
'search' => '/api/v1/categories/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/CategoryTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class CategoryTerm extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/category-terms',
'resource' => '/api/v1/category-terms/{id}',
'search' => '/api/v1/category-terms/search',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Department.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use App\Helpers\StringHelpers;

class Department extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/departments',
'resource' => '/api/v1/departments/{id}',
'search' => '/api/v1/departments/search',
Expand Down
6 changes: 3 additions & 3 deletions app/Models/Api/Exhibition.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use Illuminate\Support\Carbon;
use App\Models\Behaviors\HasFeaturedRelated;
use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Builders\ApiModelBuilder;
use App\Helpers\StringHelpers;
use Database\Factories\Api\HasApiFactory;
use Aic\Hub\Foundation\Library\Api\Models\Behaviors\HasApiFactory;

class Exhibition extends BaseApiModel
{
Expand All @@ -17,7 +17,7 @@ class Exhibition extends BaseApiModel

use HasApiFactory;

protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/exhibitions',
'resource' => '/api/v1/exhibitions/{id}',
'search' => '/api/v1/exhibitions/search',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use App\Helpers\StringHelpers;

class Gallery extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/galleries',
'resource' => '/api/v1/galleries/{id}',
'search' => '/api/v1/galleries/search',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use DamsImageService;

class Image extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/images',
'resource' => '/api/v1/images/{id}',
'search' => '/api/v1/images/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Place.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class Place extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/places',
'search' => '/api/v1/places/search'
];
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Publication.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class Publication extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/publications',
'resource' => '/api/v1/publications/{id}',
'search' => '/api/v1/publications/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Builders\ApiModelBuilderSearch;
use App\Libraries\Search\Filters\Departments as DepartmentFilter;
use Illuminate\Database\Eloquent\Builder;
Expand All @@ -13,7 +13,7 @@

class Search extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'search' => '/api/v1/search',
'msearch' => '/api/v1/msearch',
];
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class Section extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/sections',
'resource' => '/api/v1/sections/{id}',
'search' => '/api/v1/sections/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/ShopItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use App\Models\Behaviors\HasMediasApi;
use App\Helpers\ImageHelpers;

class ShopItem extends BaseApiModel
{
use HasMediasApi;

protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/products',
'resource' => '/api/v1/products/{id}',
'search' => '/api/v1/products/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/TicketedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;
use Carbon\Carbon;

class TicketedEvent extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/ticketed-events',
'resource' => '/api/v1/ticketed-events/{id}',
'search' => '/api/v1/ticketed-events/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/TicketedEventType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class TicketedEventType extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/ticketed-event-types',
'resource' => '/api/v1/ticketed-event-types/{id}',
];
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/TourStop.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class TourStop extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/mobile-sounds',
'resource' => '/api/v1/mobile-sounds/{id}',
'search' => '/api/v1/mobile-sounds/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class Video extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/videos',
'resource' => '/api/v1/videos/{id}',
'search' => '/api/v1/videos/search'
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Api/WaitTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Models\Api;

use App\Libraries\Api\Models\BaseApiModel;
use Aic\Hub\Foundation\Library\Api\Models\BaseApiModel;

class WaitTime extends BaseApiModel
{
protected $endpoints = [
protected array $endpoints = [
'collection' => '/api/v1/wait-times',
'resource' => '/api/v1/wait-times/{id}',
];
Expand Down
Loading

0 comments on commit d2a4634

Please sign in to comment.