Initial commit

This commit is contained in:
Ahrom
2025-11-16 12:43:07 +03:30
commit 4bbe56b83f
16778 changed files with 1914371 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Tools;
use Livewire\Component;
class Coments extends Component
{
public function render()
{
return view('livewire.tools.coments');
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Livewire\Tools;
use App\Models\Comment;
use Livewire\Attributes\Rule;
use Livewire\Component;
class HomeComments extends Component
{
public Comment $comments;
public Comment $comment;
#[Rule('required')]
public $comment_name;
#[Rule('required')]
public $comment_message;
public $comment_name_reply;
public $comment_message_reply;
public $blog_id;
public $comment_id;
public function mount($comments,$comment,$blog_id)
{
$this->comments = $comments;
$this->comment = $comment;
$this->blog_id = $blog_id;
// dd($this->comment);
}
public function render()
{
return view('livewire.tools.home-comments');
}
public function reply($id,$parent_id)
{
if ($this->comment_message_reply && $this->comment_name_reply){
Comment::create(['name'=>$this->comment_name_reply,'message'=>$this->comment_message_reply,'blog_id'=>$this->blog_id,'ip'=>request()->ip(),'user_agent'=>request()->userAgent(),'parent_id'=>$id,'type'=>2]);
Comment::where('id',$parent_id)->increment('reply');
$this->comment_message_reply=null;
$this->comment_name_reply=null;
}
}
}