Am working on a scenario, where I want to search for a string value from URL is matching 2 columns from the database. For example.. in my project system, there is customer first_name and last_name is there while entering web URL like website.com/nayanachandran
the word "nayanachandran" has to check from the customer database, with laravel queries like the combination of customer first_name and last_name is equal to the string in request param. currently, I did it in a way like added hi-pen in string eg: nayana-chandran
and while searching I added query in the repository like:
$publicUrl = explode("-",$this->request->unique_name);
$coach_details = Customer::where('first_name', $publicUrl['0'])->where('last_name', $publicUrl['1'])->first();
Any help ?