abort_unless

The abort_unless function throws an HTTP exception if a given boolean expression evaluates to false:
<?php abort_unless(Auth::user()->isAdmin(), 403);
<?php             return $action->authorize(User::current(), $item);

        });



        abort_unless($unauthorized->isEmpty(), 403, __('You are not authorized to run this action.'));



        $response = $action->run($items, $values = $request->all());
<?php         $container = AssetContainer::find($request->container);



        abort_unless($container->allowUploads(), 403);



        $this->authorize('store', [AssetContract::class, $container]);
<?php         $asset = Asset::find("{$containerHandle}::{$path}");



        abort_unless($container && $asset, 404);



        $this->authorize('view', $asset);
<?php {

    public function store(Request $request, $container)

    {

        abort_unless($container->createFolders(), 403);



        $request->validate([

            'path' => 'required',