3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-03-29 20:04:21 +00:00

simplified checkout event handling per @uberbrady’s suggestion

This generalizes the checkout events into the CheckoutableCheckedOut and CheckoutableCheckedIn events.
This commit is contained in:
Till Deeke
2018-09-10 16:40:26 +02:00
parent 62195a805a
commit 007e8fbdf9
23 changed files with 229 additions and 618 deletions

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Components;
use App\Events\CheckoutableCheckedIn;
use App\Events\ComponentCheckedIn;
use App\Http\Controllers\Controller;
use App\Models\Actionlog;
@ -94,7 +95,9 @@ class ComponentCheckinController extends Controller
DB::table('components_assets')->where('id', '=', $component_asset_id)->delete();
}
event(new ComponentCheckedIn($component, $component_assets, Auth::user(), $request->input('checkin_qty'), $request->input('note')));
$asset = Asset::find($component_assets->asset_id);
event(new CheckoutableCheckedIn($component, $asset, Auth::user(), $request->input('note')));
return redirect()->route('components.index')->with('success',
trans('admin/components/message.checkout.success'));