2017 © Pedro Peláez
 

library embark

A flying start for Laravel projects.

image

nerbiz/embark

A flying start for Laravel projects.

  • Friday, July 13, 2018
  • by nerbiz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 64 % Grown

The README.md

Embark

A flying start for Laravel projects., (*1)

There were some things that I did/used with new Laravel projects, so putting those things in a package speeds up that process. Maybe you'll find it useful as well. This package is in the public domain (using the Unlicense), so go ahead and use it for anything., (*2)

Installation

The intended Laravel version is 5.6, I haven't tested it in previous versions., (*3)

Include this project with Composer:
composer require nerbiz/embark 0.*, (*4)

The service provider will be autodiscovered, but for completeness, the service provider file is Nerbiz\Embark\EmbarkServiceProvider. There is no (need for a) Facade, but who knows what the future brings., (*5)

Publish the config file:
php artisan vendor:publish --tag=embark-config, (*6)

Publish some basic views:
php artisan vendor:publish --tag=embark-views, (*7)

Publish stubs, in case you'd like to customize them:
php artisan vendor:publish --tag=embark-stubs
For convenience, the 'stubs_path' value in config/embark.php already points to where the stubs are published., (*8)

Commands

These are the Artisan commands included in this package:, (*9)

  • embark:empty-class: Creates an empty class with only a constructor. The namespace for it can be configured in config/embark.php.
  • embark:migration: Works in the same way as (extends) make:migration, but uses custom stubs, which use the custom Blueprint of this package.
  • embark:model: Works in the same way as (extends) make:model, but uses custom namespace and embark:migration instead of make:migration. The namespace for it can be configured in config/embark.php.
  • embark:models-namespace: Create the App\Models namespace and move User to it, and update files that use the User model. Namespace name can be defined in config/embark.php.
  • embark:restructure: Adjusts the directory structure, creates a 'laravel' directory next to the public directory.
  • embark:webpack: Intended to use with embark:restructure, this overwrites the webpack.mix.js file, using the new public directory path.

Explanation for embark:restructure:
I guess this is mostly useful for shared hosting, or other environments with limited control., (*10)

Usually, the public directory is called 'public_html', not 'public' as in Laravel. There are usually also a number of files and directories next to the public directory, like things for stats, FTP, SSH, mailboxes etc. I don't prefer to mix those with Laravel files, so my idea was to move all those files to a separate 'laravel' directory. The end result is a 'laravel' and 'public_html' directory, next to each other., (*11)

Paths have also been taken care of in this command, so you can just start building., (*12)

Usage

Custom Blueprint

In a migration file, replace these use statements:, (*13)

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;

With these:, (*14)

use Nerbiz\Embark\Facades\Schema;
use Nerbiz\Embark\Schema\Blueprint;

Then you can use $table as usual, but the foreignKey() method has been added. foreignKey() works the same as foreign(), but it adds ->references(...)->on(...)->onUpdate(...)->onDelete(...) implicitly. For example: category_id implicitly references id on categories. The default onUpdate and onDelete values are set in config/embark.php., (*15)

Since this method returns a Fluent instance, you can use it as you would otherwise. Therefore you could for instance overwrite an implicit foreign table name: $table->foreignKey('category_id')->on('product_categories');, (*16)

My intention is to expand the custom Blueprint with more useful methods., (*17)

Contributing

Please do a pull request, if you have some improvements in mind., (*18)

License

This project uses the Unlicense., (*19)

The Versions

13/07 2018

dev-develop

dev-develop

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

13/07 2018

dev-master

9999999-dev

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

13/07 2018

0.14.0

0.14.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

12/07 2018

0.13.0

0.13.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

09/07 2018

0.12.0

0.12.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

27/06 2018

0.11.0

0.11.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

06/05 2018

0.10.0

0.10.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

06/05 2018

0.9.0

0.9.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

03/05 2018

0.8.0

0.8.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

26/04 2018

0.7.0

0.7.0.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

26/04 2018

0.6.3

0.6.3.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

26/04 2018

0.6.2

0.6.2.0

A flying start for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

25/04 2018

0.6.1

0.6.1.0

A jumpstart for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

25/04 2018

0.6.0

0.6.0.0

A jumpstart for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

22/04 2018

0.5.0

0.5.0.0

A jumpstart for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

22/04 2018

0.4.0

0.4.0.0

A jumpstart for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

20/04 2018

0.3.0

0.3.0.0

A jumpstart for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

20/04 2018

0.2.0

0.2.0.0

A jumpstart for Laravel projects.

  Sources   Download

Unlicense

The Requires

  • php ^7.1.3

 

by Sybren Dijkstra

20/04 2018

0.1.0

0.1.0.0

A jumpstart for Laravel projects.

  Sources   Download

Unlicense

by Sybren Dijkstra