FEATURE: change directory structure
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace App\CMS\Handlers\Search;
|
||||
|
||||
use App\Models\Content\Content as ContentModel;
|
||||
|
||||
class Content extends Search
|
||||
{
|
||||
/**
|
||||
* Search for given patttern/term
|
||||
*
|
||||
* @param string $term searched word
|
||||
*
|
||||
* @return array list of found objects
|
||||
*/
|
||||
public function search($term)
|
||||
{
|
||||
$token = $this->tokenize($term);
|
||||
|
||||
return ContentModel::where('content', 'LIKE', $token)
|
||||
->orWhere('meta_description', 'LIKE', $token)
|
||||
->orWhere('meta_keywords', 'LIKE', $token)
|
||||
->orWhere('title', 'LIKE', $token)
|
||||
->orWhere('url', 'LIKE', $token)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return 'content';
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return trans('search.content');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user