added uuid query scope

This commit is contained in:
Jake Mitchell
2016-06-26 01:00:13 +00:00
parent ddea4dd573
commit 70cd832876
4 changed files with 45 additions and 0 deletions

View File

@@ -126,6 +126,17 @@ class Meta extends Model implements FoundationModel, MetaContract
$this->uuid = $uuid;
$this->save();
}
/**
* Get the model that has this UUID.
*
* @param string $uuid
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public static function withUuid( $uuid ){
return parent::where('uuid', $uuid);
}
/**
* Add the UUID and Meta columns to the table.