mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
Add Champion model, form validation, and components for StreamerPanel.
- Added Champion model to StreamerPanelController. - Implemented form validation for champion_id, platform, username, and displayname in create and update methods. - Created StreamerCreateForm and StreamersTable components for better organization.
This commit is contained in:
26
app/View/Components/Streamerpanel/StreamerCreateForm.php
Normal file
26
app/View/Components/Streamerpanel/StreamerCreateForm.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Streamerpanel;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class StreamerCreateForm extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct(public $champions)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.streamerpanel.streamer-create-form');
|
||||
}
|
||||
}
|
||||
28
app/View/Components/Streamerpanel/StreamersTable.php
Normal file
28
app/View/Components/Streamerpanel/StreamersTable.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Streamerpanel;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
use App\Models\Streamer;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class StreamersTable extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct(public Collection $streamers)
|
||||
{
|
||||
$this->streamers = $streamers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View
|
||||
{
|
||||
return view('components.streamerpanel.streamers-table');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user