vendredi 18 août 2017

How to str_slug into model

search.blade.php

@foreach($search as $item)
<div class="post">
    <a href="">
</div>
@endforeach

SearchController.php

public function postSearch(SearchRequest $request){

        $search_key = $request->input('search');
        $key_space  = str_slug($search_key," ");
        $search     = moives::where('row_name','like',"%$key_space%")
                    ->orderBy('id','DESC')
                    ->get();
        if(count($search) > 0){
            return view('user.pages.search',compact('search','search_key'));        
        } 
        else {
            return view ('user.pages.search')->withMessage('No Details found. Try to search again !');
        }
    }

Url results:

http://ift.tt/2woCCUy

But i want results:

http://ift.tt/2uYdbpl

The condition here is that I can not add columns to the database, I can only retrieve data from the database

Please help me if possible.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2wo4rfT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire