feat: prepping launch
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ class ArtworkController extends Controller
|
||||
->with('artist')
|
||||
->orderBy('episode_id', 'desc')
|
||||
->orderBy('created_at', 'desc')
|
||||
->paginate($perPage = 100, $columns = ['*'], $pageName = 'artworks');
|
||||
->paginate($perPage = 3, $columns = ['*'], $pageName = 'artworks');
|
||||
$podcasts = Podcast::where('published', true)->with('episodes')->get();
|
||||
return view('explore.artworks', [
|
||||
'user' => $user,
|
||||
@@ -170,4 +170,11 @@ class ArtworkController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function legacyArtLink(Request $request, $any = null)
|
||||
{
|
||||
phpinfo();
|
||||
dd($request->path());
|
||||
//$artwork = Artwork::where('legacy_filename', '/assets/artwork/')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@ namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use App\Models\Artist;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Validation\Rules;
|
||||
@@ -31,17 +33,24 @@ class RegisteredUserController extends Controller
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'name' => ['unique:artists,name', 'required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:'.User::class],
|
||||
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
||||
]);
|
||||
|
||||
$user = User::create([
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'name' => trim($request->name),
|
||||
'email' => trim(strtolower($request->email)),
|
||||
'password' => Hash::make($request->password),
|
||||
]);
|
||||
|
||||
$artist = Artist::create([
|
||||
'user_id' => $user->id,
|
||||
'name' => trim($request->name),
|
||||
'slug' => Str::slug(trim($request->name)),
|
||||
'location' => 'No Agenda Nation',
|
||||
]);
|
||||
|
||||
event(new Registered($user));
|
||||
|
||||
Auth::login($user);
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Episode;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Artworks;
|
||||
use App\Models\Episode;
|
||||
|
||||
class EpisodeController extends Controller
|
||||
{
|
||||
@@ -44,9 +48,26 @@ class EpisodeController extends Controller
|
||||
* @param \App\Models\Episode $episode
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Episode $episode)
|
||||
public function show(Request $request, $podcast_slug, $slug)
|
||||
{
|
||||
//
|
||||
$user = auth()->user();
|
||||
$episode = Episode::where('slug', $slug)
|
||||
->with('artworks')
|
||||
->with('artwork')
|
||||
->with('podcast')
|
||||
->firstOrFail();
|
||||
$podcasts = Podcast::where('published', true)->with('episodes', function ($query) {
|
||||
$query->orderBy('episode_number', 'desc');
|
||||
$query->where('published', true);
|
||||
$query->take(10);
|
||||
})->get();
|
||||
return view('episodes.episode', [
|
||||
'user' => $user,
|
||||
'pageTitle' => '"' . $episode->title . '" ' . $episode->podcast->name . ' Episode ' . number_format($episode->episode_number + 0),
|
||||
'podcast' => $episode->podcast,
|
||||
'episode' => $episode,
|
||||
'podcasts' => $podcasts,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,8 +3,34 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Artworks;
|
||||
use App\Models\Episode;
|
||||
|
||||
|
||||
class PodcastController extends Controller
|
||||
{
|
||||
//
|
||||
public function show(Request $request, $slug)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$podcast = Podcast::where('slug', $slug)
|
||||
->where('published', true)
|
||||
->firstOrFail();
|
||||
$episodes = Episode::where('published', true)
|
||||
->whereNotNull('artwork_id')
|
||||
->with('artwork')
|
||||
->with('artworks')
|
||||
->where('podcast_id', $podcast->id)
|
||||
->orderBy('episode_number', 'desc')->paginate(100);
|
||||
$podcasts = Podcast::where('published', true)->with('episodes')->get();
|
||||
return view('podcasts.podcast', [
|
||||
'user' => $user,
|
||||
'pageTitle' => $podcast->name,
|
||||
'podcast' => $podcast,
|
||||
'episodes' => $episodes,
|
||||
'podcasts' => $podcasts,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user