Skip to content

Commit 3e47e70

Browse files
committed
[EH] use backpack route file of base v0.9
1 parent 3fa2acb commit 3e47e70

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Services/RouteService.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99

1010
class RouteService extends ServiceAbstract implements ServiceInterface
1111
{
12-
protected $relativeToBasePath = 'routes';
12+
protected $relativeToBasePath = 'routes/backpack';
1313

14-
private $adminFile;
14+
protected $fileName = 'custom.php';
15+
16+
private $routeFile;
1517

1618
public function call()
1719
{
18-
$this->adminFile = $this->getFilePath();
20+
$this->routeFile = $this->getFilePath();
1921

20-
if ($this->filesystem->exists($this->adminFile)) {
22+
if ($this->filesystem->exists($this->routeFile)) {
2123
$this->writeFile();
24+
$this->addLatestFileToIdeStack();
2225
}
23-
24-
$this->addLatestFileToIdeStack();
2526
}
2627

2728
private function getRouteName(): string
@@ -43,12 +44,12 @@ private function getControllerName(): string
4344
*/
4445
private function writeFile()
4546
{
46-
$this->filesystem->append($this->adminFile, $this->getRouteString());
47+
$this->filesystem->append($this->routeFile, $this->getRouteString());
4748
}
4849

4950
private function getFilePath()
5051
{
51-
return base_path('routes') . '/admin.php';
52+
return base_path($this->relativeToBasePath) . '/' . $this->fileName;
5253
}
5354

5455
private function getRouteString()

0 commit comments

Comments
 (0)