Home > Net >  how to convert this code into blade.php laravel
how to convert this code into blade.php laravel

Time:08-21

i am useing this code

<input type="text" name="search" value="<?php if(isset($_GET['search'])){echo 
        $_GET['search']; } ?>" placeholder="Search by name...">

so I want to chang this code into blade PHP please help me

CodePudding user response:

You can do this by -

<input type="text" name="search" value="{{ isset($_GET['search'] ? $_GET['search'] : '') }}" placeholder="Search by name...">

CodePudding user response:

Do this:

<input type="text" name="search" value="{{request()->search}}" placeholder="Search by name...">

CodePudding user response:

try this

<input type="text" name="search" value="{{ request('search') }}" placeholder="Search by name...">

  • Related