[dfae77e] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | use App\Models\Artist;
|
---|
| 4 | use App\Models\ArtistImage;
|
---|
| 5 | use App\Models\ArtistSingsGenre;
|
---|
| 6 | use App\Models\ArtistType;
|
---|
| 7 | use App\Models\Event;
|
---|
| 8 | use App\Models\EventType;
|
---|
| 9 | use App\Models\Genre;
|
---|
| 10 | use App\Models\Manager;
|
---|
| 11 | use App\Models\ManagerInvite;
|
---|
| 12 | use App\Models\Offer;
|
---|
| 13 | use App\Models\OfferComment;
|
---|
| 14 | use App\Models\Organizer;
|
---|
| 15 | use App\Models\Review;
|
---|
| 16 | use App\Models\Transaction;
|
---|
| 17 | use App\Models\User;
|
---|
| 18 | use Illuminate\Http\Request;
|
---|
| 19 | use Illuminate\Support\Facades\Route;
|
---|
| 20 |
|
---|
| 21 | /*
|
---|
| 22 | |--------------------------------------------------------------------------
|
---|
| 23 | | API Routes
|
---|
| 24 | |--------------------------------------------------------------------------
|
---|
| 25 | |
|
---|
| 26 | | Here is where you can register API routes for your application. These
|
---|
| 27 | | routes are loaded by the RouteServiceProvider within a group which
|
---|
| 28 | | is assigned the "api" middleware group. Enjoy building your API!
|
---|
| 29 | |
|
---|
| 30 | */
|
---|
| 31 |
|
---|
| 32 | Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
---|
| 33 | return $request->user();
|
---|
| 34 | });
|
---|
| 35 |
|
---|
| 36 | Route::get('/artists', function () {
|
---|
| 37 | return Artist::with('user', 'artist_type', 'manager', 'images', 'genres')->get();
|
---|
| 38 | });
|
---|
| 39 |
|
---|
| 40 | Route::get('/artist-images', function () {
|
---|
| 41 | return ArtistImage::with('artists')->get();
|
---|
| 42 | });
|
---|
| 43 |
|
---|
| 44 | Route::get('/artist-genres', function () {
|
---|
| 45 | return ArtistSingsGenre::all();
|
---|
| 46 | });
|
---|
| 47 |
|
---|
| 48 | Route::get('/artist-types', function () {
|
---|
| 49 | return ArtistType::with('artists')->get();
|
---|
| 50 | });
|
---|
| 51 |
|
---|
| 52 | Route::get('/events', function () {
|
---|
| 53 | return Event::with('organizer', 'event_type')->get();
|
---|
| 54 | });
|
---|
| 55 |
|
---|
| 56 | Route::get('/event-types', function () {
|
---|
| 57 | return EventType::with('events')->get();
|
---|
| 58 | });
|
---|
| 59 |
|
---|
| 60 | Route::get('/genres', function () {
|
---|
| 61 | return Genre::with('artists')->get();
|
---|
| 62 | });
|
---|
| 63 |
|
---|
| 64 | Route::get('/managers', function () {
|
---|
| 65 | return Manager::with('user', 'artists')->get();
|
---|
| 66 | });
|
---|
| 67 |
|
---|
| 68 | Route::get('/manager-invites', function () {
|
---|
| 69 | return ManagerInvite::with('artist')->get();
|
---|
| 70 | });
|
---|
| 71 |
|
---|
| 72 | Route::get('/offers', function () {
|
---|
| 73 | return Offer::with('artist', 'event', 'comments')->get();
|
---|
| 74 | });
|
---|
| 75 |
|
---|
| 76 | Route::get('/offer-comments', function () {
|
---|
| 77 | return OfferComment::with('offer', 'author')->get();
|
---|
| 78 | });
|
---|
| 79 |
|
---|
| 80 | Route::get('/organizers', function () {
|
---|
| 81 | return Organizer::with('user', 'events')->get();
|
---|
| 82 | });
|
---|
| 83 |
|
---|
| 84 | Route::get('/reviews', function () {
|
---|
| 85 | return Review::with('organizer', 'artist')->get();
|
---|
| 86 | });
|
---|
| 87 |
|
---|
| 88 | Route::get('/transactions', function () {
|
---|
| 89 | return Transaction::with('offer')->get();
|
---|
| 90 | });
|
---|
| 91 |
|
---|
| 92 | Route::get('/users', function () {
|
---|
| 93 | return User::with('role', 'offer_comments')->get();
|
---|
| 94 | });
|
---|