newbie360

your form like this ?

<form method="POST" action="/devoteeSearch">
    @csrf

and try

public function search(Request $request)
{
    dd('never get there');

search again, did you see never get there ?

Cruorzy

return view('dashboard', [ 'devotee' => $devotee ]);

public function search(Request $request)
{
    $UserName = $request->input('devoteeName');
    
    if (! empty($UserName))
    {
        $devotee = Devotee::where ( 'NAME', 'LIKE', '%' . $UserName . '%' )->get        (['id','NAME','CONTACT','TEMP_ADDRESS']);

        return view('pages.devoteeSearch', [
            'devotee' => $devotee
        ]);
    }
    else {
        return view('pages.devoteeSearch', [
            'devotee' => []
        ]);
    }
}

Then in your view you can do at the top <?php dd($devotee); ?>

Snapey
Snapey
1 month ago (993,685 XP)

You have

Route::get('/devoteeSearch','[email protected]');

which presumably ALSO returns view pages.devoteeSearch

so in the searchDev function, you need to pass an empty devotee array

Please sign in or create an account to participate in this conversation.