To set up CI for project, it's possible to use Travis CI (free for OSS)
Signing up:
- Go to travis-ci.org
- Sign up via GH account
- Enable CI for a repository
Configuration:
CI configuration is stored in .travis.yml
file, that contains language settings as well as commands that needs to be run when changes are pushed to repository
For CI there is also .env.travis containing special ENV settings for CI build
composer.json
- register file for autoloading
"autoload": {
"files": [
"path/to/file.php"
]
}
- create the file
- implement helper functions
- run
composer dump-autoload
To enable slugs in routing, you need to override getRouteKeName()
method on a model to set column that holds slug and by which the model will be autoloaded when resolving routing method dependencies.
old('input')
- contains previously submitted value so the form can be repopulated
- done in
AppServiceProvider::boot()
(or any custom service provider) - enables to pass extra data to the view every time it's rendered or to share it with multiple (* - all) views
View::composer(['view.name', ...], function ($view) {
$view->with('extra', $data);
})
// when sharing data in all views, then is equal to
View::share('extra', $data);
Class containing query, especially if it's rather complicated one
all()
- returns all inputs in requestonly($array)
- for each item in$array
returns it's value or null if not presentintersect($array)
- returns values for items in$array
but omits those not present