Rename Admin views directory, add some functions on models
This commit is contained in:
40
app/Repositories/Core/Comments.php
Normal file
40
app/Repositories/Core/Comments.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Core;
|
||||
|
||||
class Comments
|
||||
{
|
||||
|
||||
public static function getByModel($model)
|
||||
{
|
||||
if (!$model) {
|
||||
return false;
|
||||
}
|
||||
return $model->comments;
|
||||
}
|
||||
|
||||
public static function storeComments($model, $comments)
|
||||
{
|
||||
if ($comments) {
|
||||
foreach ($comments as $comment) {
|
||||
self::storeComment($model, $comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function storeComment($model, $comment)
|
||||
{
|
||||
return $model->comment($comment);
|
||||
}
|
||||
|
||||
public static function deleteComments($model)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function deleteComment($model, $index)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user