Download the PHP package alextigaer/rep-o-matic without Composer
On this page you can find all versions of the php package alextigaer/rep-o-matic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alextigaer/rep-o-matic
More information about alextigaer/rep-o-matic
Files in alextigaer/rep-o-matic
Package rep-o-matic
Short Description Create Laravel repositories easily!
License MIT
Homepage https://github.com/alextigaer/rep-o-matic
Informations about the package rep-o-matic
Rep-O-Matic
Create Laravel repositories easily!
Table of Contents
- Installation
- Basic usage
- Options
- --e
- --m
- --m-fillable
- --m-hidden
- --r
- --n
- --n-types
- --migrate
- --s
- --s-instances
- --seed
- Usage examples
- Contributing
- License
Installation
Basic usage
To create a new repository, just run the command:
This will create:
- 4 exceptions for the repository: 'RepoNameNotFoundException', 'RepoNameNotCreatedException', 'RepoNameNotUpdatedException' and 'RepoNameNotDeletedException'
- The model file 'RepoName.php' inside the 'Models' directory
- The 'Repositories' directory with 2 directories inside: 'Contracts' and 'RepoName'. The 'Contracts' directory will contain all the repositories' contracts. The 'RepoName' directory will contain all the repositories for 'RepoName'. The command will also bind the contract to the repository's file
- The migration 'create_reponames_table'
- The 'RepoNamesSeeder'. The command will also update the 'DatabaseSeeder' file, adding the line to call 'RepoNamesSeeder'
Options
If you want, you can use these options to customize the creation:
--e (default=y)
This option allows to choose if the exceptions should be created. The default value is set to 'y'. Other values are not considered
Description:
Usage:
--m (default=y)
This option allows to choose if the model should be created. The default value is set to 'y'. Other values are not considered
Description:
Usage:
--m-fillable
The option '--m-fillable' allows to add mass-assignable attributes to the model (and to the migration and the seeder too)
Description:
Usage:
--m-hidden
The option '--m-hidden' allows to add hidden attributes to the model (and to the migration and the seeder too)
Description:
Usage:
--r (default=y)
This option allows to choose if the repository should be created. The default value is set to 'y'. Other values are not considered
Description:
Usage:
--n (default=y)
This option allows to choose if the migration should be created. The default value is set to 'y'. Other values are not considered
Description:
Usage:
--n-types
The option '--n-types' allows to add the types to the migration columns. If not specified, the command will assign the type 'string' to all of the columns (if --m-fillable and/or --m-hidden are used)
Description:
Usage:
--migrate (default=n)
This option allows to choose if the migrate command should be run. The default value is set to 'n'. Other values are not considered
Description:
Usage:
--s (default=y)
This option allows to choose if the seeder should be created. The default value is set to 'y'. Other values are not considered
Description:
Usage:
--s-instances
The option '--s-instances' allows to add some instances to the seeder. If not specified, the command will assign the value 'VALUE' to all of the columns (if --m-fillable and/or --m-hidden are used). A default separator for the values, the character ',', is set. The syntax to add an instance is: '--s-instances="value_1,value2,...,value_n""'
Description:
Usage:
--seed (default=n)
This option allows to choose if the seed command should be run. The default value is set to 'n'. Other values are not considered
Description:
Usage:
Usage examples
1) Create a repo called 'ExampleOne' with 3 mass-assignable attributes, 1 hidden attribute, column types set and without creating the seeder:
2) Create a repo called 'ExampleTwo' without mass-assignable attributes, 1 hidden attribute, 2 instances and run the seeding:
Contributing
Feel free to suggest anything! Use pulls or contact me :)
License
Rep-O-Matic is licensed under the MIT license. Made with love, let's share it! :)