Files
ahrommag/app/Livewire/Search.php
2025-11-16 12:43:07 +03:30

33 lines
729 B
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Livewire;
use App\Models\Blog;
use App\Models\Post;
use Livewire\Component;
use Livewire\Attributes\Url;
use Livewire\WithPagination;
use Livewire\WithoutUrlPagination;
class Search extends Component
{
use WithPagination, WithoutUrlPagination;
public $search = '';
public $showMenu = false;
public function refreshsearch()
{
$this->resetPage();
}
public function render()
{
$kName = htmlspecialchars_decode($this->search, ENT_QUOTES);
$search = str_replace('', '***', $kName);
$this->showMenu = true;
return view('livewire.search', ['blogsSearchs' => Blog::where('content', 'like', '%' . $search . '%')->paginate(5)]);
}
}