Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ $ php artisan admin:import helpers

See [wiki](http://laravel-admin.org/docs/#/en/extension-helpers?id=helpers)

## Scaffold templates (stubs)
Copy `src/Scaffold/stubs` to your project `app/stubs` and add to your `.env` file:
```
ADMIN_STUBS_DIR=/app/stubs/
```

## Donate

> Help keeping the project development going, by donating a little. Thanks in advance.
Expand Down
3 changes: 2 additions & 1 deletion src/Scaffold/ControllerCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function getPath($name)
*/
public function getStub()
{
return __DIR__.'/stubs/controller.stub';
return (getenv("ADMIN_STUBS_DIR") || __DIR__.'/stubs/'). 'controller.stub';

}
}
2 changes: 1 addition & 1 deletion src/Scaffold/MigrationCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function create($name, $path, $table = null, $create = true)

$path = $this->getPath($name, $path);

$stub = $this->files->get(__DIR__.'/stubs/create.stub');
$stub = $this->files->get((getenv("ADMIN_STUBS_DIR") || __DIR__.'/stubs/'). 'create.stub');

$this->files->put($path, $this->populateStub($name, $stub, $table));

Expand Down
2 changes: 1 addition & 1 deletion src/Scaffold/ModelCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,6 @@ public function replaceSpace($stub)
*/
public function getStub()
{
return __DIR__.'/stubs/model.stub';
return (getenv("ADMIN_STUBS_DIR") || __DIR__.'/stubs/'). 'model.stub';
}
}