2018-07-21 05:00:17 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Events;
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
2018-09-10 07:40:26 -07:00
|
|
|
class CheckoutableCheckedIn
|
2018-07-21 05:00:17 -07:00
|
|
|
{
|
|
|
|
use Dispatchable, SerializesModels;
|
|
|
|
|
2018-09-10 07:40:26 -07:00
|
|
|
public $checkoutable;
|
2018-07-21 05:00:17 -07:00
|
|
|
public $checkedOutTo;
|
|
|
|
public $checkedInBy;
|
|
|
|
public $note;
|
2019-03-13 21:36:32 -07:00
|
|
|
public $action_date; // Date setted in the hardware.checkin view at the checkin_at input, for the action log
|
2018-09-10 07:40:26 -07:00
|
|
|
|
2018-07-21 05:00:17 -07:00
|
|
|
/**
|
|
|
|
* Create a new event instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2020-05-12 11:36:14 -07:00
|
|
|
public function __construct($checkoutable, $checkedOutTo, User $checkedInBy, $note, $action_date = null)
|
2018-07-21 05:00:17 -07:00
|
|
|
{
|
2018-09-10 07:40:26 -07:00
|
|
|
$this->checkoutable = $checkoutable;
|
2018-07-21 05:00:17 -07:00
|
|
|
$this->checkedOutTo = $checkedOutTo;
|
|
|
|
$this->checkedInBy = $checkedInBy;
|
|
|
|
$this->note = $note;
|
2020-05-12 11:36:14 -07:00
|
|
|
$this->action_date = $action_date ?? date('Y-m-d');
|
2018-07-21 05:00:17 -07:00
|
|
|
}
|
|
|
|
}
|