mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
596 B
PHTML
28 lines
596 B
PHTML
5 months ago
|
<?php
|
||
|
|
||
|
namespace Resources\Views\Segments;
|
||
|
|
||
|
use App\Models\Part;
|
||
|
|
||
|
class SimpleComments
|
||
|
{
|
||
|
public static function onAdd(Part $part = null)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
public static function onRemove(Part $part = null)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
public static function onMount(Part $part = null, $model = null)
|
||
|
{
|
||
|
if ($model == null){
|
||
|
return $part;
|
||
|
}
|
||
|
$part->comments = $model->approvedComments()->whereNull('parent_id')->orderBy('id','desc')->get();
|
||
|
$part->commentable_type = get_class($model);
|
||
|
$part->commentable_id = $model->id;
|
||
|
return $part;
|
||
|
}
|
||
|
}
|