使用laravel从DB调用返回

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.

Use this to get name:

$rpSystemCreatedBy[0]->name

It's just an example which will return name of the first row. To get all names in your template, use @foreach:

@foreach ($rpSystemCreatedBy as $a)
    {{ $a->name }}
@endforeach

Or in controller:

foreach ($rpSystemCreatedBy as $a){
    $theName = $a->name;
}