nukacode / lumen-base
The Laravel Lumen Framework with nukacode.
Installs: 411
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 0
Open Issues: 0
Type:project
Requires
- hashids/hashids: 1.0.*
- laravel/lumen-framework: 5.0.*
- league/fractal: 0.12.*
- vlucas/phpdotenv: ~1.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-11-27 21:15:19 UTC
README
- Facades, Eloquent and DotEnv are enabled. Comment the lines in
bootstrap/app.php
out if you don't need them. - Configs folder added. If you want to add a config file, look to Lumen Docs.
app/Http/routes.php
contains a/status
route 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
->hashId
to 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_ID
constant. This will be the models salt.- This is checked in the
BaseModel
constructor 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
];
}
}