Download the PHP package codedungeon/laravel-craftsman without Composer

On this page you can find all versions of the php package codedungeon/laravel-craftsman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-craftsman

Laravel Craftsman

Description

Laravel Craftsman (written using the awesome Laravel-Zero CLI builder) provides a suite of crafting assets using a project agnostic CLI.

You can quickly create class, command, controller, event, factory, form-request, listener, migration, model, resource, rule, seed, test and view assets.

In addition, you can create all assets with a single command, allowing you to quickly craft a new resource in seconds!

πŸ“ Laravel News Article

πŸ“¦ Packagist

Table Of Conents

Installation

Using Composer

Using curl/wget

Usage

Commands

The following commands are available in any Laravel project. You can use the individual crafting routines which are similar to the Artisan commands, but the craft:all command is the most powerful of the bunch.

Using craft:all you can easily generate all assets (controller, factory, migration, model, and seed) for a given resource (ie Post, Customer, etc)

🚩Required Parameter / Option

Command Name / Option Description
interactive Run Interactive Mode (uses wizard to craft resources
--silent, -s Skips Wizard Instructions
publish Publish templates to project diretory
==> all craft:xxx commands will use project template if it exists
--skip-config, -c Skip publishing craftsman configuration file
--overwrite, -o Overwrites published templates directory
craft:api Craft API Resources (create model, controller, factory, migration, seed)
🚩 base name Based resource name for all assets (example Contact)
🚩 --model, -m Path to model (eg App/Models/Post)
--table, -t Tablename used in database (will set \$tablename in Model)
If not supplied, default table will be pluralized model name
--rows, -r Number of rows used by seed when using Factory
--current, -u Use --useCurrent for timestamps when creating migration
--no-model, -o Do not create model
--no-controller, -c Do not create controller
--no-factory, -f Do not create factory
--no-migration, -g Do not create migration
--no-seed, -s Do not create seed
--overwrite, -w Overwrite existing class
craft:all Creates all assets (Controller, Factory, Migration, Model, Seed)
🚩 base name Based resource name for all assets
🚩 --model, -m Path to model (eg App/Models/Post)
--tablename, -t Tablename used in database (will set \$tablename in Model)
If not supplied, default table will be pluralized model name
--rows, -r Number of rows used by seed when using Factory
--extends, -x View extends block (optional)
--section, -i View section block (optional)
--no-controller, -c Do not create controller
--no-factory, -a Do not create factory
--no-migration, -g Do not create migration
--no-model, -o Do not create model
--no-seed, -s Do not create seed
--no-views, -e Do not create seed
craft:class Creates empty class
🚩 class name Class path (eg App/Services/MyService)
--constructor, -c Include constructor method
--template, -t Path to custom template (override config file)
--overwrite, -w Overwrite existing class
craft:command Creates Artisan Command class
🚩 command name Command name
--signature, -s Command Signature
--description, -d Command Description
--template, -t Path to custom template (override config file)
--overwrite, -w Overwrite existing class
craft:controller Create controller using supplied options
🚩 controller name Controller Name
--model, -m Path to model (eg App/Models/Post)
--validation, -l Create validation blocks where appropriate
--api, -a Create API controller (skips create and update methods)
--binding, -b Include route / model binding (requires model property)
--empty, -e Create empty controller
--resource, -r Create resource controller
--template, -t Path to custom template (override config file)
--overwrite, -w Overwrite existing class
craft:event Creates event class
🚩 event name Event Name
--listener, -l Generate Listener
--no-broadcast, -b Skips broadcast code when event class created
--template, -t Path to custom template (override config file)
--overwrite, -w Overwrite existing class
craft:factory Creates factory using supplied options
🚩 factory name Factory Name
--model, -m Path to model (eg App/Models/Post)
craft:listener Creates listener class
🚩 listener name Listener Name
--event, -e The event class be listener for
--queued Indicates the event listener should be queued
--template, -t Path to custom template (override config file)
--overwrite, -w Overwrite existing class
craft:migration Creates migration using supplied options
🚩 migration name Migration Name (eg create*contacts_table)
--model, -m Path to model (required)
--table, -t Tablename used in database (will set \$tablename in Model)
_If not supplied, default table will be pluralized model name*
--fields, -f List of fields (option) see syntax below
🚨 If you have spaces separating fields, you must surround fields list in quotes
--foreign, -r Add foreign key constraint (foreign info) see syntax below
--current, -u Use --useCurrent for timestamps (skipped by default)
--down, -d Include down methods (skipped by default)
--template, -t Path to custom template (override config file)
--overwrite, -w Overwrite existing class
craft:model Creates model using supplied options
🚩 model name Model Name (eg Contact or App/Models/Contact)
See below about defining alternate model path
--all, -a Generate a migration, factory, and controller for the model
--table, -t Tablename used in database (will set \$tablename in Model)
If not supplied, default table will be pluralized model name
--template, -m Path to custom template (override config file)
--controller, -c Create a new controller
--factory, -f Create factory
--migration, -m Create a new migration file file
--seed, -s Create a new seed file file
--overwrite, -w Overwrite existing class
craft:request Creates form request using supplied options
🚩 request name Request Name
See below about defining alternate model path
--rules, -r List of rules (optional)
🚨 If you have spaces separating fields, you must surround rules lists in quotes
--template, -m Path to custom template (override config file)
--overwrite, -w Overwrite existing class

| craft:rule | | Creates validation rule | | | 🚩 Rule Name | Rule Name (eg Uppercase) | | | --template, -t | Path to custom template (override config file) | | | --overwrite, -w | Overwrite existing class | | craft:seed | | Creates seed file using supplied options | | | 🚩 Seed Name | Seed Name (eg ContactTableSeeder) | | | 🚩 --model, -m | Path to model (eg App/Models/Post) | | | --factory, -f | Create Factory (if it does not already exists) | | | --rows, -r | Number of rows to use in factory call (Optional) | | | --template, -t | Path to custom template (override config file) | | | --overwrite, -w | Overwrite existing class | | craft:test | | Creates seed file using supplied options | | | 🚩 Test Name | Test Name (eg CreateFileTest) | | | --setup, -s | Include setUp method | | | --teardown, -d | Include tearDown method | | | --unit, -u | Create unit test (default will be Feature test) | | | --pest, -p | Create Pest test | | | --template, -t | Path to custom template (override config file) | | | --overwrite, -w | Overwrite existing class | | craft:views | 🚩 base resource | Seed name | | | --setup, -s | Include setup block | | | --teardown, -d | Include tearDown block | | | --unit, -u | Create unit test | | | --template, -t | Path to custom template (override config file) | | | --overwrite, -w | Overwrite existing class | | craft:views | 🚩 base resource | Creates view files | | | --extends, -x | Includes extends block using supplied layout | | | --section, -s | Includes section block using supplied name | | | --no-create, -c | Exclude create view | | | --no-edit, -d | Exclude edit view | | | --no-index, -i | Exclude index view | | | --no-show, -w | Exclude show view |

Defining Class Path

When crafting resources which are not automatically created in their assigned directories, you can define the location to the path where asset is created as follows:

This will create a class in the App/Services path, with filename Sync.php. Directories (including nested directories) will be created if they do not already exists.

Supported Commands

The following commands support defining class path

πŸ“ Template Access

Laravel Craftsman will use sensible default templates which are located in the laravel-craftsman installation location. If you wish to have greater control over templates, you can publish (see laravel-craftsman publish command) default templates into the project directory (<project>/templates).

Subsequent laravel-craftsman craft:xxx commands will first look in the project templates directory, if template not found, then it will use the application templates.

Single Use Templates

In addition to the standard templates, you may also define a single use template which is only used during command execution. Single use templates are designed to reference project specific templates, and you use the <projet> keyword when executing the desire command.

oh-my-zsh Conflict

If you have oh-my-zsh installed, make sure you wrap template value in quotes, otherwise you may receive an error

Foreign Key Syntax

When using the --foreign option when building migrations, you should use the following syntax:

Alternatively, you can supply just the foreign key part (using table_key format) and it will be used to extract the primary table and key. The primary table will be a plural version of the first part, followed by the primary key id.

will be translated internally to use the full --foreign format

Automatic foreign key field creation

When using the --foreign flag, the appropriate field will be added automatically in migration file. For example, if the --foreign post_id flag is supplied, the following will be added to new migration

Field Option Syntax

When using the --fields option when building migrations, you should use the following syntax: Note: If you have used teh --foreign flag as outlined above, the foreign key field will be added automatically

Rules Option Syntax

When using the --rules option when building form requests, you should use the following syntax:

Produces the following

Tips

πŸ’‘ Boolean Option Shortcut

When executing any of the laravel-craftsman commands, if you wish to apply one or more switches (those options which do not require a corresponding value), you can use the standard CLI shorthands (this tip can be used in any CLI based tool, not just laravel-craftsman (well assuming the CLI actually supports shorthand).

For example:

Lets assume you wish to wish to create views, you can use the following command to skip creation of the create (-c), edit (-d) and show (-w) views (only creating the index view). The combination of -cdw is shorthand for --no-create --no-edit --no-show

is same as

πŸ’‘ Defining Nested Paths

Any command can store assets within tested folders within default path by separating name argument with forward slash For example, the following command will define the path for model asset in the App/Models/<name> path

Custom Templates

Laravel Craftsman provides support for creating custom templates if you wish to change the syntax to match your personal style. The default templates use the standard Laravel syntax, but we like to allow ou have your own flair (see laravel-craftsman publish for greater template control).

πŸ“ User Custom Templates

If you wish to create derivatives of the supported templates, you can customize the config.php located in the laravel-craftsman directory. By default, this will be ~/.composer/vendor/codedungeon/laravel-craftsman, but may be different depending on the method you chose to install laravel-craftsman.

πŸ“ Single Use Template

In addition to creating templates and configuring the config.php file, you may optionally supply a template to be used as single use (not stored) from all command execution For example, if you wish to create a standard class asset, you can use a single use template as follows:

Placeholder to represent current project directory ./ Placeholder to represent current project directory Placeholder to computer root directory πŸ“ **Template Variables** The following variables can be used in any of the supported templates (review the `templates` directory for a basis of how to create custom templates) | Variable Name | Templates which variable is used | | ------------- | ------------------------------------------------------------------------------------------- | | `binding` | Used by `binding controller` | | `fields` | Used by `migration` | | `model` | Used by `api-controller`, `class`, `controller`, `factory`, `migration`, `model` and `seed` | | `model_path` | Used by `api-controller`, `controller`, `factory`, `migration`, `seed` | | `name` | Used by `event`, `listener`, `rule`, `api-controller`, `controller` and `empty-controller` | | `namespace` | Used by `class`, `model` | | `num_rows` | Used by `seed` | | `rules` | Used by `request` | | `tablename` | Used by `controller`, `migration`, `model` | | `extends` | Used by `views` | | `section` | Used by `views` | | `foreign` | Used by `migration` | | `current` | Used by `migration` | ## License Copyright © 2019-2020 Mike Erickson Released under the MIT license ## Credits laravel-craftsman written by Mike Erickson E-Mail: [[email protected]](mailto:[email protected]) Twitter: [@codedungeon](http://twitter.com/codedungeon) Website: [codedungeon.io](http://codedungeon.io)

All versions of laravel-craftsman with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
codedungeon/php-messenger Version ^1.0
codedungeon/phpunit-result-printer Version ^0.27
illuminate/log Version 5.8.*
laravel-zero/framework Version 5.8.*
mustache/mustache Version ^2.12
nunomaduro/laravel-console-menu Version ^2.1
nunomaduro/phpinsights Version ^1.9
padraic/phar-updater Version ^1.0.6
phpunit/phpunit Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codedungeon/laravel-craftsman contains the following files

Loading the files please wait ....