Get type parameter value from URL with livewire

Viewed 5966

I wanted to get the value of type from the url "example.com/user?type=agent" using livewire.

I have tried using Input::get('type') but is not working in livewire component class

4 Answers

I don't know livewire, but it's looks like laravel. Just try

Input::query('type')
This is the example you can try:
        public $type;
        protected $queryString = ['type'];
        
        return view('bladefile',[
                    'posts' => Post::where('title', 'like', '%'.$this->type.'%')->get(),
                ]);
          }
     
Related