type; // TODO: move this to middleware if (! $broker instanceof Broker) { abort(403, 'This user is not a broker.'); } /** * Create the initials from a full name (e.g. John Doe, Alex Mark, jane clerk) * to display on profile page (e.g. JD, AM, JC). */ $initials = Str::of($profile->name) ->explode(' ') ->map(fn ($word) => Str::substr(ucfirst($word), 0, 1)) ->join(''); return view('dashboards.broker.profile.show') ->with('name', $profile->name) ->with('joinDate', $profile->created_at->format('F Y')) ->with('email', $profile->email) ->with('initials', $initials) ->with('verified', $broker->verified) ->with('location', $broker->location) ->with('phone', $broker->phone); } /** * Show the form for editing the specified resource. */ public function edit(string $id) { // } /** * Update the specified resource in storage. */ public function update(Request $request, string $id) { // } /** * Remove the specified resource from storage. */ public function destroy(string $id) { // } }