nukacode/lumen-base
The Laravel Lumen Framework with nukacode.
411
3
| Install | |
|---|---|
composer require nukacode/lumen-base |
|
| Latest Version: | 1.0.1 |
| License: | MIT |
| Last Updated: | May 12, 2015 |
| Links: | GitHub · Packagist |
Maintainer: stygiansabyss
General Lumen changes
- Facades, Eloquent and DotEnv are enabled. Comment the lines in
bootstrap/app.phpout if you don't need them. - Configs folder added. If you want to add a config file, look to Lumen Docs.
app/Http/routes.phpcontains a/statusroute that will return a 200 response with JSON "ok".
Models
- All models return collections as an instance of
App\Support\Collection. - All models can now tap
->hashIdto get a hashed version of it's id. - All models now have
findHash(). This works the same asfind()but expects the hashed id. - All models are expected to set a
HASH_IDconstant. This will be the models salt.- This is checked in the
BaseModelconstructor and will throw an exception if it's not found.
- This is checked in the
Transformers
- Docs: Fractal
- Example Class
<?php namespace App\Transformers;
use App\Models\Video;
class VideoTransformer extends BaseTransformer {
public function transform(Video $video)
{
return [
'id' => $video->hashId
];
}
}