I am using Laravel 5.5 and I have a config file in dir app\Json\Schemas\TestSchema.php
which contains an array with configurations like this:
return [
'value' => 'string'
];
What is the best way to include file dynamically?
In my model
namespace App;
use App\Json\Traits\JsonModel;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
public function getJsonSchema($schema)
{
return 'App\\Json\\Schemas\\'.$schema;
}
}