From b878740f80ce7cfe2a0bc53956e3f7e4e0aa2f78 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 10 Nov 2019 21:30:26 +0100 Subject: News: Bug fixes, cleanup, comments & formatting Use more magically available methods and properties Fixed atom feed and stats not using the new model --- src/Models/News.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/Models/News/News.php | 30 ------------------------------ src/Models/User/User.php | 2 +- 3 files changed, 46 insertions(+), 31 deletions(-) create mode 100644 src/Models/News.php delete mode 100644 src/Models/News/News.php (limited to 'src/Models') diff --git a/src/Models/News.php b/src/Models/News.php new file mode 100644 index 00000000..55ab9c1d --- /dev/null +++ b/src/Models/News.php @@ -0,0 +1,45 @@ + 'boolean', + ]; + + /** @var array */ + protected $fillable = [ + 'title', + 'text', + 'is_meeting', + 'user_id', + ]; +} diff --git a/src/Models/News/News.php b/src/Models/News/News.php deleted file mode 100644 index ae67752b..00000000 --- a/src/Models/News/News.php +++ /dev/null @@ -1,30 +0,0 @@ - 'boolean', - ]; - - protected $attributes = [ - 'is_meeting' => false, - ]; - - protected $fillable = [ - 'title', - 'text', - 'is_meeting', - 'user_id', - ]; -} diff --git a/src/Models/User/User.php b/src/Models/User/User.php index cca96dbe..058f9a8c 100644 --- a/src/Models/User/User.php +++ b/src/Models/User/User.php @@ -4,7 +4,7 @@ namespace Engelsystem\Models\User; use Carbon\Carbon; use Engelsystem\Models\BaseModel; -use Engelsystem\Models\News\News; +use Engelsystem\Models\News; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Query\Builder as QueryBuilder; -- cgit v1.2.3-70-g09d2