source: routes/api.php

Last change on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[dfae77e]1<?php
2
3use App\Models\Artist;
4use App\Models\ArtistImage;
5use App\Models\ArtistSingsGenre;
6use App\Models\ArtistType;
7use App\Models\Event;
8use App\Models\EventType;
9use App\Models\Genre;
10use App\Models\Manager;
11use App\Models\ManagerInvite;
12use App\Models\Offer;
13use App\Models\OfferComment;
14use App\Models\Organizer;
15use App\Models\Review;
16use App\Models\Transaction;
17use App\Models\User;
18use Illuminate\Http\Request;
19use 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
32Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
33 return $request->user();
34});
35
36Route::get('/artists', function () {
37 return Artist::with('user', 'artist_type', 'manager', 'images', 'genres')->get();
38});
39
40Route::get('/artist-images', function () {
41 return ArtistImage::with('artists')->get();
42});
43
44Route::get('/artist-genres', function () {
45 return ArtistSingsGenre::all();
46});
47
48Route::get('/artist-types', function () {
49 return ArtistType::with('artists')->get();
50});
51
52Route::get('/events', function () {
53 return Event::with('organizer', 'event_type')->get();
54});
55
56Route::get('/event-types', function () {
57 return EventType::with('events')->get();
58});
59
60Route::get('/genres', function () {
61 return Genre::with('artists')->get();
62});
63
64Route::get('/managers', function () {
65 return Manager::with('user', 'artists')->get();
66});
67
68Route::get('/manager-invites', function () {
69 return ManagerInvite::with('artist')->get();
70});
71
72Route::get('/offers', function () {
73 return Offer::with('artist', 'event', 'comments')->get();
74});
75
76Route::get('/offer-comments', function () {
77 return OfferComment::with('offer', 'author')->get();
78});
79
80Route::get('/organizers', function () {
81 return Organizer::with('user', 'events')->get();
82});
83
84Route::get('/reviews', function () {
85 return Review::with('organizer', 'artist')->get();
86});
87
88Route::get('/transactions', function () {
89 return Transaction::with('offer')->get();
90});
91
92Route::get('/users', function () {
93 return User::with('role', 'offer_comments')->get();
94});
Note: See TracBrowser for help on using the repository browser.