How to make my search box work properly in laravel

I was to search for animals details in my project but unfortunately in my controller I do not know what to do to configuer it. public function index() { $animals =Animal::all(); $result = false; if (request()->has(‘search’) && request()->get(‘search’) != ”){ $result = $animals->where(‘serial_number’, ‘like’, “%” .request()->get(‘search’).”%”)->get(); } return view(‘home’, [‘result’ => $result])->with(‘message’, ‘Below is the…

Getting error of php version in Laravel 6 composer update even though my php version is 7.2.1

I downloaded a laravel 6 demo project and setting it up in my mac mamp. Initialy my php version was 7.1.23 and i was getting this error. Warning: require(/Applications/MAMP/htdocs/laravel_demo/public/../vendor/autoload.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/laravel_demo/public/index.php on line 26 Fatal error: require(): Failed opening required ‘/Applications/MAMP/htdocs/laravel_demo/public/../vendor/autoload.php’ (include_path=’.:/Applications/MAMP/bin/php/php7.2.1/lib/php’) in /Applications/MAMP/htdocs/laravel_demo/public/index.php on line…

Sorting after user comments rating in Laravel

I am beginner in Laravel. I make project in Laravel 5.8. I have 2 tables: users and comments. Each comment has a rating. One user can have many comments. I have this code: Schema::create(‘users’, function (Blueprint $table) { $table->bigIncrements(‘id’); $table->string(’email’, 120)->unique(); $table->timestamp(’email_verified_at’)->nullable(); $table->string(‘password’); …… $table->rememberToken(); $table->timestamps(); $table->engine = “InnoDB”; $table->charset = ‘utf8mb4’; $table->collation = ‘utf8mb4_unicode_ci’;…

Passing more than three parameter to route in Laravel

I got an error “Missing required parameters for Route” although I used a correct. Who can support me, please? Route::Group([‘prefix’ => ‘shop’], function () { Route::get(‘product_page/orderby/{pa1}/rangeform/{pa2}/rangeto/{pa3}/type/{pa4}’, [‘as’ => ‘product_page’, ‘uses’ => ‘shopcontroller@product_page’]); }); public function product_page($orderby,$rangeForm,$rangeTo,$type){ // do something } <a href=””><img src=”/source/images/p1.jpg” class=”img-responsive” alt=”” /> “Missing required parameters for [Route: product_page] [URI: shop/product_page/orderby/{pa1}/rangeform/{pa2}/rangeto/{pa3}/type/{pa4}]. (View:…

I’m trying to use laravel and I keep getting PDO exception error since it cant find my driver [duplicate]

This question already has an answer here: Laravel 5.4 on PHP 7.0: PDO Exception – Could not find driver (MySQL) 10 answers I’m trying to connect my database to laravel and nothing seems to work. !https://imgur.com/cbPWU20 no matter what i always get the PDO exception error I already removed the semicolons for extension=php_pdo_pgsql.dll and extension=php_pgsql.dll,…