NukaCode / lumen-base by stygiansabyss

The Laravel Lumen Framework with nukacode.
411
3
5
Package Data
Maintainer Username: stygiansabyss
Package Create Date: 2015-05-08
Package Last Update: 2015-05-12
Language: PHP
License: MIT
Last Refreshed: 2024-11-22 03:15:26
Package Statistics
Total Downloads: 411
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 3
Total Watchers: 5
Total Forks: 0
Total Open Issues: 0

General Lumen changes

  • 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 as find() 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.

Transformers


    <?php namespace App\Transformers;
    
    use App\Models\Video;
    
    class VideoTransformer extends BaseTransformer {

	public function transform(Video $video)
	{
		return [
			'id' => $video->hashId
		];
	}

    }