-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
591 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/Nova/Actions/Models/Wiki/Song/AttachSongResourceAction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Actions\Models\Wiki\Song; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Models\Wiki\ExternalResource; | ||
use App\Nova\Actions\Models\Wiki\AttachResourceAction; | ||
use App\Rules\Wiki\Resource\SongResourceLinkFormatRule; | ||
use Illuminate\Contracts\Validation\ValidationRule; | ||
use Illuminate\Database\Eloquent\Relations\BelongsToMany; | ||
|
||
/** | ||
* Class AttachSongResourceAction. | ||
*/ | ||
class AttachSongResourceAction extends AttachResourceAction | ||
{ | ||
/** | ||
* Get the relation to the action models. | ||
* | ||
* @param ExternalResource $resource | ||
* @return BelongsToMany | ||
*/ | ||
protected function relation(ExternalResource $resource): BelongsToMany | ||
{ | ||
return $resource->song(); | ||
} | ||
|
||
/** | ||
* Get the format validation rule. | ||
* | ||
* @param ResourceSite $site | ||
* @return ValidationRule | ||
*/ | ||
protected function getFormatRule(ResourceSite $site): ValidationRule | ||
{ | ||
return new SongResourceLinkFormatRule($site); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/Nova/Lenses/Anime/Resource/AnimeYoutubeResourceLens.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Lenses\Anime\Resource; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Nova\Lenses\Anime\AnimeResourceLens; | ||
|
||
/** | ||
* Class AnimeYoutubeResourceLens. | ||
*/ | ||
class AnimeYoutubeResourceLens extends AnimeResourceLens | ||
{ | ||
/** | ||
* The resource site. | ||
* | ||
* @return ResourceSite | ||
*/ | ||
protected static function site(): ResourceSite | ||
{ | ||
return ResourceSite::YOUTUBE; | ||
} | ||
|
||
/** | ||
* Get the URI key for the lens. | ||
* | ||
* @return string | ||
* | ||
* @noinspection PhpMissingParentCallCommonInspection | ||
*/ | ||
public function uriKey(): string | ||
{ | ||
return 'anime-youtube-resource-lens'; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/Nova/Lenses/Artist/Resource/ArtistSpotifyResourceLens.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Lenses\Artist\Resource; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Nova\Lenses\Artist\ArtistResourceLens; | ||
|
||
/** | ||
* Class ArtistSpotifyResourceLens. | ||
*/ | ||
class ArtistSpotifyResourceLens extends ArtistResourceLens | ||
{ | ||
/** | ||
* The resource site. | ||
* | ||
* @return ResourceSite | ||
*/ | ||
protected static function site(): ResourceSite | ||
{ | ||
return ResourceSite::SPOTIFY; | ||
} | ||
|
||
/** | ||
* Get the URI key for the lens. | ||
* | ||
* @return string | ||
* | ||
* @noinspection PhpMissingParentCallCommonInspection | ||
*/ | ||
public function uriKey(): string | ||
{ | ||
return 'artist-spotify-resource-lens'; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/Nova/Lenses/Artist/Resource/ArtistYoutubeResourceLens.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Lenses\Artist\Resource; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Nova\Lenses\Artist\ArtistResourceLens; | ||
|
||
/** | ||
* Class ArtistYoutubeResourceLens. | ||
*/ | ||
class ArtistYoutubeResourceLens extends ArtistResourceLens | ||
{ | ||
/** | ||
* The resource site. | ||
* | ||
* @return ResourceSite | ||
*/ | ||
protected static function site(): ResourceSite | ||
{ | ||
return ResourceSite::YOUTUBE; | ||
} | ||
|
||
/** | ||
* Get the URI key for the lens. | ||
* | ||
* @return string | ||
* | ||
* @noinspection PhpMissingParentCallCommonInspection | ||
*/ | ||
public function uriKey(): string | ||
{ | ||
return 'artist-youtube-resource-lens'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
app/Nova/Lenses/Song/Resource/SongAmazonMusicResourceLens.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Lenses\Song\Resource; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Nova\Lenses\Song\SongResourceLens; | ||
|
||
/** | ||
* Class SongAmazonMusicResourceLens. | ||
*/ | ||
class SongAmazonMusicResourceLens extends SongResourceLens | ||
{ | ||
/** | ||
* The resource site. | ||
* | ||
* @return ResourceSite | ||
*/ | ||
protected static function site(): ResourceSite | ||
{ | ||
return ResourceSite::AMAZON_MUSIC; | ||
} | ||
|
||
/** | ||
* Get the URI key for the lens. | ||
* | ||
* @return string | ||
* | ||
* @noinspection PhpMissingParentCallCommonInspection | ||
*/ | ||
public function uriKey(): string | ||
{ | ||
return 'song-amazon-music-resource-lens'; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/Nova/Lenses/Song/Resource/SongAppleMusicResourceLens.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Lenses\Song\Resource; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Nova\Lenses\Song\SongResourceLens; | ||
|
||
/** | ||
* Class SongAppleMusicResourceLens. | ||
*/ | ||
class SongAppleMusicResourceLens extends SongResourceLens | ||
{ | ||
/** | ||
* The resource site. | ||
* | ||
* @return ResourceSite | ||
*/ | ||
protected static function site(): ResourceSite | ||
{ | ||
return ResourceSite::APPLE_MUSIC; | ||
} | ||
|
||
/** | ||
* Get the URI key for the lens. | ||
* | ||
* @return string | ||
* | ||
* @noinspection PhpMissingParentCallCommonInspection | ||
*/ | ||
public function uriKey(): string | ||
{ | ||
return 'song-apple-music-resource-lens'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Lenses\Song\Resource; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Nova\Lenses\Song\SongResourceLens; | ||
|
||
/** | ||
* Class SongSpotifyResourceLens. | ||
*/ | ||
class SongSpotifyResourceLens extends SongResourceLens | ||
{ | ||
/** | ||
* The resource site. | ||
* | ||
* @return ResourceSite | ||
*/ | ||
protected static function site(): ResourceSite | ||
{ | ||
return ResourceSite::SPOTIFY; | ||
} | ||
|
||
/** | ||
* Get the URI key for the lens. | ||
* | ||
* @return string | ||
* | ||
* @noinspection PhpMissingParentCallCommonInspection | ||
*/ | ||
public function uriKey(): string | ||
{ | ||
return 'song-spotify-resource-lens'; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/Nova/Lenses/Song/Resource/SongYoutubeMusicResourceLens.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Lenses\Song\Resource; | ||
|
||
use App\Enums\Models\Wiki\ResourceSite; | ||
use App\Nova\Lenses\Song\SongResourceLens; | ||
|
||
/** | ||
* Class SongYoutubeMusicResourceLens. | ||
*/ | ||
class SongYoutubeMusicResourceLens extends SongResourceLens | ||
{ | ||
/** | ||
* The resource site. | ||
* | ||
* @return ResourceSite | ||
*/ | ||
protected static function site(): ResourceSite | ||
{ | ||
return ResourceSite::YOUTUBE_MUSIC; | ||
} | ||
|
||
/** | ||
* Get the URI key for the lens. | ||
* | ||
* @return string | ||
* | ||
* @noinspection PhpMissingParentCallCommonInspection | ||
*/ | ||
public function uriKey(): string | ||
{ | ||
return 'song-youtube-music-resource-lens'; | ||
} | ||
} |
Oops, something went wrong.