mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Use route name prefix
This commit is contained in:
@@ -14,7 +14,7 @@ class Page extends \Filament\Pages\Page
|
||||
|
||||
public static function generateUrl($parameters = [], $absolute = true)
|
||||
{
|
||||
return route('filament.resources.' . static::getResource()::getSlug() . '.' . static::route()->name, $parameters, $absolute);
|
||||
return route(static::getResource()::getRouteNamePrefix() . '.' . static::getResource()::getSlug() . '.' . static::route()->name, $parameters, $absolute);
|
||||
}
|
||||
|
||||
public static function getModel()
|
||||
|
||||
@@ -39,7 +39,7 @@ class Resource
|
||||
$name = static::router()->getIndexRoute()->name;
|
||||
}
|
||||
|
||||
return route(static::$routeNamePrefix . '.' . static::getSlug() . '.' . $name, $parameters, $absolute);
|
||||
return route(static::getRouteNamePrefix() . '.' . static::getSlug() . '.' . $name, $parameters, $absolute);
|
||||
}
|
||||
|
||||
public static function getIcon()
|
||||
@@ -88,6 +88,11 @@ class Resource
|
||||
return (string) Str::plural(static::getLabel());
|
||||
}
|
||||
|
||||
public static function getRouteNamePrefix()
|
||||
{
|
||||
return static::$routeNamePrefix;
|
||||
}
|
||||
|
||||
public static function getSlug()
|
||||
{
|
||||
if (static::$slug) {
|
||||
|
||||
Reference in New Issue
Block a user