Download the PHP package whitecube/laravel-preset without Composer
On this page you can find all versions of the php package whitecube/laravel-preset. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download whitecube/laravel-preset
More information about whitecube/laravel-preset
Files in whitecube/laravel-preset
Package laravel-preset
Short Description Custom Laravel Preset for the Whitecube workflow.
License MIT
Homepage https://github.com/whitecube/laravel-preset
Informations about the package laravel-preset
Whitecube Laravel Preset
This preset will install and setup everything that is needed for new Laravel projects at Whitecube.
To start a new project:
-
Create the new Laravel project
-
Install the preset
-
Activate the preset
- You're done! You can now compile, watch, etc!
Everything you'd expect should be there, and you can get to work right away.
Setting up new Hiker projects
After doing the above commands, do the following:
-
Add the Hiker repository to the
composer.json
file: -
The, run the following terminal commands:
-
When prompted, add your Hiker.dev user & license. You can store these credentials in a
auth.json
, but don't forget to add this file to the project's.gitignore
! - Finally, run Hiker's installation command:
Publish the base files for common components
This package ships with a set of publishable components that will help setup the project's front-end basics in a few seconds. The following command will prompt for the components you can install:
`
Creating new publishable components
In order to create a publishable component, one should simply create a new "Publisher" class inside src/Components/Publishers
and implement Whitecube\LaravelPreset\Components\PublisherInterface
:
Most of the heavy-lifting will be achieved inside the publisher's handle()
method. For instance, it's a great place to prompt for additional component-specific information and configure the publishable files accordingly.
The handle()
method's main purpose is to collect and return the publishable files, that's why this package provides a File
class with several useful methods and features. First, you can choose to create a File
instance using one of these methods:
File::makeFromStub(string $destination, string $stub)
: useful when working with existing files ;File::make(string $destination, string $content, ?string $origin = null)
: useful when creating files from scratch.
Most of the time, File::makeFromStub
should be used in order to keep a clear commit history on the component's original files somewhere in this package's components/[your-component]
directory.
These File
instances can be manipulated before publication with a few useful methods:
$sassFile->replaceVariableValue('wysiwyg_width_columns', 10)
;$sassFile->replaceBemBase('wysiwyg', 'foo')
;$bladeFile->replaceBemBase('wysiwyg', 'foo')
;
Of course, Laravel Prompts can be used anywhere inside a publisher's handle()
method, which is useful for file configuration: