type check for route parameter

This commit is contained in:
Sevan Nerse 2022-06-14 22:12:19 +03:00
parent 39ec0617ed
commit f89a72170e

View File

@ -200,7 +200,15 @@ class DeleteButton extends Component
$page = '';
if (! empty($this->route)) {
$page = explode('.', $this->route)[0];
if (! is_array($this->route)) {
$string = $this->route;
}
if (is_array($this->route)) {
$string = $this->route[0];
}
$page = explode('.', $string)[0];
} elseif (! empty($this->url)) {
$page = explode('/', $this->url)[1];
}