1

I have the following function in my controller

 public function approve($uin)
{
    $dir_uin = Approval::where('dir_uin',$uin)->get();


    return view('approvals.approve')->withApprovals($dir_uin);
}

and

in my view

     @php
@dd($dir_uin)
   @endphp

@dd returns a null and i have checked with tinker if the data is being fetched.

any reason why the data is not being passed to the view?

0

2 Answers 2

1

You are passing the parameter as approvals, so in your view, it should be:

dd($approvals)

Which would be the value of $dir_uin.

Sign up to request clarification or add additional context in comments.

Comments

1

use this return view('admin.profile', ["dir_uin" => $dir_uin]);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.