File "FrontendController.php"

Full Path: /home/bettaeza/flyinsyria.com/modules/FrontendController.php
File size: 610 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
namespace Modules;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

class FrontendController extends Controller
{
    public function __construct()
    {

    }

    public function checkPermission($permission = false)
    {
        if ($permission) {
            if (!Auth::check() or !Auth::user()->hasPermission($permission)) {
                abort(403);
            }
        }
    }

    public function hasPermission($permission)
    {
        if(!Auth::check()) return false;
        return Auth::user()->hasPermission($permission);
    }
}