PHP code example of pionl / laravel-config-class-gate

1. Go to this page and download the library: Download pionl/laravel-config-class-gate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pionl / laravel-config-class-gate example snippets




return [
	"user" => App\\Models\\User::class
];

$userGate = ClassGate::gate("user");
$users = $userGate->all() // will call User::all()

// will call User::all()
$users = ClassGate::gate("user")->all();

$userGate = ClassGate::gate("user");
$user = $userGate->newInstance();

$user = ClassGate::instance("user");
$user = $userGate->theClass();

$userGate = ClassGate::gate("user");

$userClass = ClassGate::objectClass("user");



return [	
	"othersKeys" : "...",
	"list" => [
		"user" => App\\Models\\User::class
	]
];