Drop the with users on the create checkout screen

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-07-11 16:00:08 +01:00
parent 759bb822ff
commit 9676d934d2

View file

@ -4,12 +4,11 @@ namespace App\Http\Controllers\Consumables;
use App\Events\CheckoutableCheckedOut;
use App\Http\Controllers\Controller;
use App\Models\Accessory;
use App\Models\Consumable;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Input;
use \Illuminate\Contracts\View\View;
use \Illuminate\Http\RedirectResponse;
class ConsumableCheckoutController extends Controller
{
@ -20,13 +19,11 @@ class ConsumableCheckoutController extends Controller
* @see ConsumableCheckoutController::store() method that stores the data.
* @since [v1.0]
* @param int $id
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function create($id)
public function create($id) : View | RedirectResponse
{
if ($consumable = Consumable::with('users')->find($id)) {
if ($consumable = Consumable::find($id)) {
$this->authorize('checkout', $consumable);