Stylistic refactoring

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-10-04 16:37:33 -07:00
parent ba0483b33e
commit bcebc1e33b

View file

@ -226,19 +226,17 @@ class ProfileController extends Controller
* *
* @author A. Gianotto * @author A. Gianotto
* @since [v6.0.12] * @since [v6.0.12]
* @return \Illuminate\Http\RedirectResponse * @return Illuminate\View\View
*/ */
public function printInventory() public function printInventory()
{ {
$show_user = User::where('id', Auth::user()->id)->withTrashed()->first(); $show_user = Auth::user();
$assets = Asset::where('assigned_to', Auth::user()->id)->where('assigned_type', User::class)->with('model', 'model.category')->get();
$accessories = $show_user->accessories()->get();
$consumables = $show_user->consumables()->get();
return view('users/print')->with('assets', $assets) return view('users/print')
->with('assets', Auth::user()->assets)
->with('licenses', $show_user->licenses()->get()) ->with('licenses', $show_user->licenses()->get())
->with('accessories', $accessories) ->with('accessories', $show_user->accessories()->get())
->with('consumables', $consumables) ->with('consumables', $show_user->consumables()->get())
->with('show_user', $show_user) ->with('show_user', $show_user)
->with('settings', Setting::getSettings()); ->with('settings', Setting::getSettings());
} }