Loading app/Database/Migrations/2020-06-05-170000_add_episodes.php +8 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,14 @@ class AddEpisodes extends Migration $this->forge->addForeignKey('created_by', 'users', 'id'); $this->forge->addForeignKey('updated_by', 'users', 'id'); $this->forge->createTable('episodes'); // Add Full-Text Search index on title and description_markdown $prefix = $this->db->getPrefix(); $createQuery = <<<CODE_SAMPLE ALTER TABLE {$prefix}episodes ADD FULLTEXT(title, description_markdown); CODE_SAMPLE; $this->db->query($createQuery); } public function down(): void Loading app/Resources/icons/search.svg 0 → 100644 +6 −0 Original line number Diff line number Diff line <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617z"/> </g> </svg> No newline at end of file app/Views/Components/Button.php +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class Button extends Component $variantClass = [ 'default' => 'text-black bg-gray-300 hover:bg-gray-400', 'primary' => 'text-accent-contrast bg-accent-base hover:bg-accent-hover', 'secondary' => 'border-2 border-accent-base text-accent-base bg-transparent hover:border-accent-hover hover:text-accent-hover', 'secondary' => 'border-2 border-accent-base text-accent-base bg-white hover:border-accent-hover hover:text-accent-hover', 'success' => 'text-white bg-pine-500 hover:bg-pine-800', 'danger' => 'text-white bg-red-600 hover:bg-red-700', 'warning' => 'text-black bg-yellow-500 hover:bg-yellow-600', Loading composer.lock +7046 −7674 File changed.Preview size limit exceeded, changes collapsed. Show changes modules/Admin/Controllers/EpisodeController.php +14 −3 Original line number Diff line number Diff line Loading @@ -63,14 +63,25 @@ class EpisodeController extends BaseController public function list(): string { /** @var ?string $query */ $query = $this->request->getGet('q'); if ($query !== null && $query !== '') { $episodes = (new EpisodeModel()) ->where('podcast_id', $this->podcast->id) ->where("MATCH (title, description_markdown) AGAINST ('{$query}')"); } else { $episodes = (new EpisodeModel()) ->where('podcast_id', $this->podcast->id) ->orderBy('created_at', 'desc'); } helper('form'); $data = [ 'podcast' => $this->podcast, 'episodes' => $episodes->paginate(10), 'pager' => $episodes->pager, 'query' => $query, ]; replace_breadcrumb_params([ Loading Loading
app/Database/Migrations/2020-06-05-170000_add_episodes.php +8 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,14 @@ class AddEpisodes extends Migration $this->forge->addForeignKey('created_by', 'users', 'id'); $this->forge->addForeignKey('updated_by', 'users', 'id'); $this->forge->createTable('episodes'); // Add Full-Text Search index on title and description_markdown $prefix = $this->db->getPrefix(); $createQuery = <<<CODE_SAMPLE ALTER TABLE {$prefix}episodes ADD FULLTEXT(title, description_markdown); CODE_SAMPLE; $this->db->query($createQuery); } public function down(): void Loading
app/Resources/icons/search.svg 0 → 100644 +6 −0 Original line number Diff line number Diff line <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617z"/> </g> </svg> No newline at end of file
app/Views/Components/Button.php +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class Button extends Component $variantClass = [ 'default' => 'text-black bg-gray-300 hover:bg-gray-400', 'primary' => 'text-accent-contrast bg-accent-base hover:bg-accent-hover', 'secondary' => 'border-2 border-accent-base text-accent-base bg-transparent hover:border-accent-hover hover:text-accent-hover', 'secondary' => 'border-2 border-accent-base text-accent-base bg-white hover:border-accent-hover hover:text-accent-hover', 'success' => 'text-white bg-pine-500 hover:bg-pine-800', 'danger' => 'text-white bg-red-600 hover:bg-red-700', 'warning' => 'text-black bg-yellow-500 hover:bg-yellow-600', Loading
modules/Admin/Controllers/EpisodeController.php +14 −3 Original line number Diff line number Diff line Loading @@ -63,14 +63,25 @@ class EpisodeController extends BaseController public function list(): string { /** @var ?string $query */ $query = $this->request->getGet('q'); if ($query !== null && $query !== '') { $episodes = (new EpisodeModel()) ->where('podcast_id', $this->podcast->id) ->where("MATCH (title, description_markdown) AGAINST ('{$query}')"); } else { $episodes = (new EpisodeModel()) ->where('podcast_id', $this->podcast->id) ->orderBy('created_at', 'desc'); } helper('form'); $data = [ 'podcast' => $this->podcast, 'episodes' => $episodes->paginate(10), 'pager' => $episodes->pager, 'query' => $query, ]; replace_breadcrumb_params([ Loading