athenahr/app/Services/CommentService.php
miguel456 3727c84f3e
refactor: code style changes
Signed-off-by: miguel456 <me@nogueira.codes>
2023-01-15 00:04:00 +00:00

25 lines
498 B
PHP
Executable File

<?php
namespace App\Services;
use App\Application;
use App\Comment;
use Illuminate\Support\Facades\Auth;
class CommentService
{
public function addComment(Application $application, $comment): Comment
{
return Comment::create([
'authorID' => Auth::user()->id,
'applicationID' => $application->id,
'text' => $comment,
]);
}
public function deleteComment(Comment $comment): ?bool
{
return $comment->delete();
}
}