diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-09-16 12:06:18 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2018-09-16 12:06:18 +0200 |
commit | 0734807eef5a6b638b06d57aef6ee59ac78a3456 (patch) | |
tree | 3af73fdc293ab18962078c1a92e07d803009f1f5 /src/Models/BaseModel.php | |
parent | d0abc27c079f058c40a74b89e54bd21ba4aad53e (diff) | |
parent | ac48332166ce28fcb1a2fc130c7f5adbc760e42d (diff) |
Merge remote-tracking branch 'MyIgel/logentry-model'
Diffstat (limited to 'src/Models/BaseModel.php')
-rw-r--r-- | src/Models/BaseModel.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Models/BaseModel.php b/src/Models/BaseModel.php new file mode 100644 index 00000000..cf718e4f --- /dev/null +++ b/src/Models/BaseModel.php @@ -0,0 +1,23 @@ +<?php + +namespace Engelsystem\Models; + +use Illuminate\Database\Eloquent\Model; + +abstract class BaseModel extends Model +{ + /** @var bool Disable timestamps by default because of "Datensparsamkeit" */ + public $timestamps = false; + + /** + * @param array $attributes + * @return BaseModel + */ + public function create(array $attributes = []) + { + $instance = new static($attributes); + $instance->save(); + + return $instance; + } +} |