Download the PHP package timehunter/laravel-file-generator without Composer
On this page you can find all versions of the php package timehunter/laravel-file-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download timehunter/laravel-file-generator
More information about timehunter/laravel-file-generator
Files in timehunter/laravel-file-generator
Package laravel-file-generator
Short Description A Laravel File Generator to automate creation of interface, trait and class files.
License MIT
Homepage https://github.com/timehunter/laravel-file-generator
Informations about the package laravel-file-generator
Laravel File Generator
A Laravel File Generator which allows you to:
- quickly generate trait, class and interface
- automate the creation of repeated php files
- help you generate code base structure (modular,pattern etc.)
The main logic is using Blade template engine to populate the files. Feel free to look into the source code.
Preview Demo
Generation Demo
Next Release features
- will support command line generator
- will support schema validation
- will cover tests
- will support webpage realtime preview
Requirement
This package requires the following dependencies:
- Laravel 5.x
- php > 7 (if you need support for version below 7, please create issue ticket)
Installation
Via Composer
If your Laravel framework version <= 5.4, please register the service provider in your config file: /config/app.php, otherwise please skip it.
And also ( Laravel framework version <= 5.4)
Usage
Step 1
Create a file template in which you tell the generator what information will be appended to your file. e.g. the following is an example of Interface file template which implements InterfaceSimpleTemplateInterface:
- getTemplateData() : return your interface details, please refer to Schema section
Step 2
Pass the template to the publish function from LaravelFileGenerator facade class
Step 3
Check your folders if the file is generated.
You can also review the class before publishing:
The function returns a View, so you can include it in any controller to see the outcome.
Interfaces
Interface | Usage | Description |
---|---|---|
ClassSimpleTemplateInterface | array schema type | Class file |
InterfaceSimpleTemplateInterface | array schema type | Interface file |
TraitSimpleTemplateInterface | array schema type | Trait file |
For array schema type, they have the same function which returns schema of template:
Trait Schema
Interface Schema
Class Schema
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
MIT. Please see the license file for more information.