I am currently trying to return a certain value from my database call in my controller with laravel. My controller currently looks like this:
public function systemView(Request $request, $id){
$rpSystemCreatedBy = DB::table('rp_systems')->join('users', 'users.id', '=', 'rp_systems.user_id_creator')->select('users.name')->get();
return $rpSystemCreatedBy;
}
The return value returns:
[{"name":"Dan Marks"}]
I want to return just:
Dan Marks
However I have tried multiple different way and I keep getting an error that ["name"] is invalid. Ive used a var dump and i get this:
array(1) { [0]=> object(stdClass)#180 (1) { ["name"]=> string(9) "Dan Marks" } }
I am now stuck and do not know how to continue. Thank you for any help.