How I can put composite keys in models in Laravel 5?

I wrote this simple PHP trait to adapt Eloquent to handle composite keys: <?php namespace App\Model\Traits; // *** Adjust this to match your model namespace! *** use Illuminate\Database\Eloquent\Builder; trait HasCompositePrimaryKey { /** * Get the value indicating whether the IDs are incrementing. * * @return bool */ public function getIncrementing() { return false; } /** … Read more