From f0acf47101514cea59b4315ecf2410d43e475772 Mon Sep 17 00:00:00 2001 From: Till Deeke Date: Sat, 21 Jul 2018 14:00:17 +0200 Subject: [PATCH] Adds checkin events --- app/Events/AccessoryCheckedIn.php | 33 +++++++++++++++++ app/Events/AssetCheckedIn.php | 33 +++++++++++++++++ app/Events/ComponentCheckedIn.php | 35 +++++++++++++++++++ app/Events/LicenseCheckedIn.php | 33 +++++++++++++++++ .../Assets/AssetCheckinController.php | 3 ++ 5 files changed, 137 insertions(+) create mode 100644 app/Events/AccessoryCheckedIn.php create mode 100644 app/Events/AssetCheckedIn.php create mode 100644 app/Events/ComponentCheckedIn.php create mode 100644 app/Events/LicenseCheckedIn.php diff --git a/app/Events/AccessoryCheckedIn.php b/app/Events/AccessoryCheckedIn.php new file mode 100644 index 0000000000..812e072b28 --- /dev/null +++ b/app/Events/AccessoryCheckedIn.php @@ -0,0 +1,33 @@ +accessory = $accessory; + $this->checkedOutTo = $checkedOutTo; + $this->checkedInBy = $checkedInBy; + $this->note = $note; + } +} diff --git a/app/Events/AssetCheckedIn.php b/app/Events/AssetCheckedIn.php new file mode 100644 index 0000000000..455b2b5d4e --- /dev/null +++ b/app/Events/AssetCheckedIn.php @@ -0,0 +1,33 @@ +asset = $asset; + $this->checkedOutTo = $checkedOutTo; + $this->checkedInBy = $checkedInBy; + $this->note = $note; + } +} diff --git a/app/Events/ComponentCheckedIn.php b/app/Events/ComponentCheckedIn.php new file mode 100644 index 0000000000..283ea6e358 --- /dev/null +++ b/app/Events/ComponentCheckedIn.php @@ -0,0 +1,35 @@ +component = $component; + $this->checkedOutTo = $checkedOutTo; + $this->checkedInBy = $checkedInBy; + $this->quantity = $quantity; + $this->note = $note; + } +} diff --git a/app/Events/LicenseCheckedIn.php b/app/Events/LicenseCheckedIn.php new file mode 100644 index 0000000000..36562296b7 --- /dev/null +++ b/app/Events/LicenseCheckedIn.php @@ -0,0 +1,33 @@ +license = $license; + $this->checkedOutTo = $checkedOutTo; + $this->checkedInBy = $checkedInBy; + $this->note = $note; + } +} diff --git a/app/Http/Controllers/Assets/AssetCheckinController.php b/app/Http/Controllers/Assets/AssetCheckinController.php index 7eed360a6a..26f77e7fcd 100644 --- a/app/Http/Controllers/Assets/AssetCheckinController.php +++ b/app/Http/Controllers/Assets/AssetCheckinController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Assets; +use App\Events\AssetCheckedIn; use App\Helpers\Helper; use App\Http\Controllers\Controller; use App\Http\Requests\AssetCheckinRequest; @@ -85,6 +86,8 @@ class AssetCheckinController extends Controller $asset->logCheckin($target, e(request('note'))); + event(new AssetCheckedIn($asset, $target, Auth::user(), $request->input('note'))); + if ($backto=='user') { return redirect()->route("users.show", $user->id)->with('success', trans('admin/hardware/message.checkin.success')); }