feat: prepping launch

This commit is contained in:
2023-12-14 11:30:49 -06:00
parent c352d4d273
commit 2ec4405b7b
49 changed files with 3006 additions and 182 deletions

View File

@@ -3,6 +3,9 @@
namespace App\Http\Controllers;
use App\Models\Artist;
use App\Models\Artwork;
use App\Models\Podcast;
use App\Models\Episode;
use Illuminate\Http\Request;
class ArtistController extends Controller
@@ -14,7 +17,18 @@ class ArtistController extends Controller
*/
public function index()
{
//
$user = auth()->user();
$artists = Artist::whereHas('artworks')
->withCount('artworks')
->orderBy('artworks_count', 'desc')
->paginate(100);
$podcasts = Podcast::where('published', true)->with('episodes')->get();
return view('profile.artists', [
'user' => $user,
'pageTitle' => 'Artists',
'podcasts' => $podcasts,
'artists' => $artists,
]);
}
/**
@@ -44,9 +58,23 @@ class ArtistController extends Controller
* @param \App\Models\Artist $artist
* @return \Illuminate\Http\Response
*/
public function show(Artist $artist)
public function show(Request $request, $slug)
{
//
$user = auth()->user();
$artist = Artist::where('slug', $slug)
->firstOrFail();
$artworks = Artwork::where('artist_id', $artist->id)
->with('episode')
->with('podcast')
->orderBy('artworks.created_at', 'desc')
->paginate($perPage = 92, $columns = ['*'], $pageName = 'artworks');
$podcasts = Podcast::where('published', true)->with('episodes')->get();
return view('profile.artist', [
'user' => $user,
'artist' => $artist,
'artworks' => $artworks,
'podcasts' => $podcasts,
]);
}
/**