Passing Data to Component View Blade

Passing data into blade template

public function index()
{
    $this->data['currentAdminMenu'] = 'dashboard';

    return view('dashboard', [
        'data' => $this->data
    ]);
    // OR
    return view('dashboard')->with('data', $this->data);
}

variable by the name of data can be access inside blade