Created
November 20, 2018 00:40
-
-
Save roni-estein/6932f766e6da75337235a168115cc674 to your computer and use it in GitHub Desktop.
App\Http\Controller.php for click through behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Foundation\Bus\DispatchesJobs; | |
use Illuminate\Routing\Controller as BaseController; | |
use Illuminate\Foundation\Validation\ValidatesRequests; | |
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | |
use phpDocumentor\Reflection\Types\Self_; | |
use Prophecy\Exception\Doubler\MethodNotFoundException; | |
class Controller extends BaseController | |
{ | |
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; | |
public static function at($action) | |
{ | |
if(method_exists(static::class, $action)) | |
return [static::class, $action]; | |
Throw new MethodNotFoundException('Method '. $action. '() not found in class '. static::class,static::class,$action); | |
} | |
public static function res() | |
{ | |
return '\\'.static::class; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment