Good night, I have a code that substitutes the data from the request and displays it, like this:
$client = User::find($data['$id']);
$execute = 'Send command ';
$execute .= $client->id;
dd($execute);
It return
^ "Send command 1"
Everything is working. But I want that if I add a variable to the database, for example, like this
$client->id
, and call it, then I need the code to process it as a variable, and not as a string, how to do this, thanks)
Example: (inside the variable $cliend in the database will be the following code:
$client->id
Code:
$client = DB::table('users')->where('id', $id)->value('id');
$execute = 'Send command ';
$execute .= $client;
dd($execute);
It is necessary that this variable be executed as a variable. and returned its value not from the database, but as in the first example
$clientholds a variable, then you can access it correspondinglyeval()untrusted user input but I don't think there is a way to do this using variables variable so use this at your own discretion - this just means your database design is failing if you're doing this.