feat: Add streamers to champion show view

- Added loading of streamers data in the champion show view.
- Updated ChampionController to load streamers for display.
This commit is contained in:
Rico van Zelst
2024-03-23 02:48:08 +01:00
parent b46128ec26
commit e6dcfacb31
10 changed files with 127 additions and 126 deletions

View File

@@ -14,7 +14,7 @@ class StreamerPanelController extends Controller
public function index()
{
return view('streamerpanel.index', [
'streamers' => Streamer::all(),
'streamers' => Streamer::with('champion')->get(),
]);
}
@@ -33,8 +33,7 @@ class StreamerPanelController extends Controller
*/
public function store(Request $request)
{
$request->validate([
'champion_id' => 'required|exists:champions,id',
$request->validate(['champion_id' => 'required|exists:champions,champion_id',
'platform' => 'required|in:twitch,youtube,kick,douyu,huya',
'username' => 'required|string',
'displayname' => 'required|string',