Laravel get data from database with ID from unique URL

  database, laravel, php, routes

I have simple problem but is hard solve this for me.

My Addin from excel create unique URL and with datas (param1,mobile_number,message) send to Laravel API. Main identifier is param1

Laravel route

Route::get('/{param1}', '[email protected]')->name('sendSms');


id  |  param1  |  mobile_number  |  message     |
1   |  abc     |  123456789      |   Hi there   |

My goal is when i open the URL i got text message with message to my mobile which is stored in database.

But problem is how to identify in controller my $mobile_number for param1 in URL.

When i open URL with dd($param1) get abc.

Is there some way how get other columns from database ?

laravel controller

public function index($param1)


Source: Laravel

Leave a Reply