classes/Helpers.php
public function controllerForModel($model)
    {
        // Swap out the namespace if decoy
        $controller = str_replace('Bkwld\Decoy\Models', 'Bkwld\Decoy\Controllers', $model, $is_decoy);

        // Replace non-decoy controller's with the standard model namespace
        if (!$is_decoy) {
            $namespace = ucfirst(Config::get('decoy.core.dir'));
            $controller = str_replace('App\\', 'App\Http\Controllers\\'.$namespace.'\\', $controller);
        }

        // Make it plural
        $offset = strrpos($controller, '\\') + 1;
        return substr($controller, 0, $offset).Str::plural(substr($controller, $offset));
    }
public function controllerForModel($model)
    {
        // Swap out the namespace if decoy
        $controller = str_replace('Bkwld\Decoy\Models', 'Bkwld\Decoy\Controllers', $model, $is_decoy);

        // Replace non-decoy controller's with the standard model namespace
        if (!$is_decoy) {
            $namespace = ucfirst(Config::get('decoy.core.dir'));
            $controller = str_replace('App\\', 'App\Http\Controllers\\'.$namespace.'\\', $controller);
        }

        // Make it plural
        $offset = strrpos($controller, '\\') + 1;
        return substr($controller, 0, $offset).Str::plural(substr($controller, $offset));
    }
public function controllerForModel ( $ model ) { // Swap out the namespace if decoy $ controller = str_replace ( 'Bkwld\Decoy\Models' , 'Bkwld\Decoy\Controllers' , $ model , $ is_decoy ) ; // Replace non-decoy controller's with the standard model namespace if ( ! $ is_decoy ) { $ namespace = ucfirst ( Config :: get ( 'decoy.core.dir' ) ) ; $ controller = str_replace ( 'App\\' , 'App\Http\Controllers\\' . $ namespace . '\\' , $ controller ) ; } // Make it plural $ offset = strrpos ( $ controller , '\\' ) + 1 ; return substr ( $ controller , 0 , $ offset ) . Str :: plural ( substr ( $ controller , $ offset ) ) ; }
Get the controller class string from a model class string

@param  string $controller ex: "App\Person"
@return string ex: "App\Http\Controllers\Admin\People"
Get the controller class string from a model class string