iqbalfarhan/lrtsengine

laravel 12 react template starter engine

Installs: 10

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/iqbalfarhan/lrtsengine

v1.10 2025-10-15 17:41 UTC

This package is auto-updated.

Last update: 2025-10-15 17:42:12 UTC


README


<?php

namespace App\Http\Controllers;

use App\Models\User;
use Illuminate\Support\Facades\Auth;

abstract class Controller
{
    protected ?User $user;

    public function __construct()
    {
        $this->user = Auth::user();
    }

    public function pass(string $ability, mixed $arguments = null): bool
    {
        abort_unless($this->user?->can($ability, $arguments), 403);
        return true;
    }
}