Search Form – WordPress-Like Blog Laravel 5.7 and AdminLTE 3 (19)

WordPress-Like Blog Laravel 5.7 and AdminLTE 3 (19) – Search Form

In this nineteenth part of creating WordPress-Like Blog using Laravel 5.7 and AdminLTE 3, we will :

  1. Create a Search Form for the Posts

Create Search Form

To begin with, you need to open frontend layouts in layouts/sidebar.blade.php and activate the search form and wrapped it into a form :

Add these lines to blog/index.blade.php to show the search term :

Next we will make the search form functional. Open the BlogController.php and modify the index() method :

Open App\Post.php and add a new scopeFilter() :

Now your search term has worked perfectly.

Search-Form---Wordpress-Like-Blog-Laravel-5.7-and-AdminLTE-3-(19-3)

Add this line to index.blade.php in pagination section :

Github commit.

 

4 thoughts on “Search Form – WordPress-Like Blog Laravel 5.7 and AdminLTE 3 (19)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.