Initial Commit
This commit is contained in:
commit
ddf09fe00c
113 changed files with 187148 additions and 0 deletions
54
app/View/Components/Card.php
Normal file
54
app/View/Components/Card.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
use App\Models\Card as CardModel;
|
||||
|
||||
class Card extends Component
|
||||
{
|
||||
/**
|
||||
* Card number
|
||||
*/
|
||||
public int $number;
|
||||
|
||||
/**
|
||||
* The card
|
||||
*/
|
||||
public CardModel $card;
|
||||
|
||||
/**
|
||||
* If the card is flipped
|
||||
*/
|
||||
public bool $flipped;
|
||||
|
||||
|
||||
/**
|
||||
* If the card is flagged as winning.
|
||||
*/
|
||||
public bool $win;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(int $number, CardModel $card, bool $flipped = false, bool $win = false)
|
||||
{
|
||||
$this->number = $number;
|
||||
$this->card = $card;
|
||||
$this->flipped = $flipped;
|
||||
$this->win = $win;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Closure|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.card');
|
||||
}
|
||||
}
|
||||
Reference in a new issue