Rename Admin views directory, add some functions on models

This commit is contained in:
Ludovic CANDELLIER
2021-07-27 22:12:58 +02:00
parent daeece59c9
commit 9a0601d473
229 changed files with 81 additions and 349 deletions

View 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;
}
}