PHPackages                             raid/core-gate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. raid/core-gate

ActiveLibrary

raid/core-gate
==============

Raid Core Gate Package

043PHP

Since Mar 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/MohamedKhedr700/core-gate)[ Packagist](https://packagist.org/packages/raid/core-gate)[ RSS](/packages/raid-core-gate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Core Gate Package
=================

[](#core-gate-package)

This package is responsible for handling all gates in the system.

Installation
------------

[](#installation)

```
composer require raid/core-gate
```

Configuration
-------------

[](#configuration)

```
php artisan core:publish-gate
```

Usage
-----

[](#usage)

```
class PostController extends Controller
{
    /**
     * Invoke the controller method.
     */
    public function __invoke(Post $post)
    {
        Post::gates('show', $post);

        // or using the authorize method.
        Post::gates()->authorize('show', $post);

        return response()->json([
            'resource' => $post,
        ]);
    }
}
```

How to work this
================

[](#how-to-work-this)

Let's start with our gateable class ex:`Post` model.

```
