Skip to content

Commit 7068cae

Browse files
committed
use ltrim php native function
1 parent 2e65af0 commit 7068cae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/Library/CrudPanel/CrudPanel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,7 @@ public function getSqlDriverList()
180180
*/
181181
public function setRoute($route)
182182
{
183-
$this->route = Str::of($route)->whenStartsWith('/', function ($string) {
184-
return Str::after($string, '/');
185-
});
183+
$this->route = ltrim($route, '/');
186184
}
187185

188186
/**
@@ -196,6 +194,8 @@ public function setRoute($route)
196194
*/
197195
public function setRouteName($route, $parameters = [])
198196
{
197+
$route = ltrim($route, '.');
198+
199199
$complete_route = $route.'.index';
200200

201201
if (! \Route::has($complete_route)) {

0 commit comments

Comments
 (0)