mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Add base routes for managing servers as a client
This commit is contained in:
@@ -32,6 +32,11 @@ class ApiSubstituteBindings extends SubstituteBindings
|
||||
'user' => User::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Routing\Router
|
||||
*/
|
||||
protected $router;
|
||||
|
||||
/**
|
||||
* Perform substitution of route parameters without triggering
|
||||
* a 404 error if a model is not found.
|
||||
@@ -45,6 +50,10 @@ class ApiSubstituteBindings extends SubstituteBindings
|
||||
$route = $request->route();
|
||||
|
||||
foreach (self::$mappings as $key => $model) {
|
||||
if (! is_null($this->router->getBindingCallback($key))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->router->model($key, $model, function () use ($request) {
|
||||
$request->attributes->set('is_missing_model', true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user