undefined variable template2 v5.2

Posted 1 year ago by muazzamazaz
$result = User::where("device_token", "!=", "")->where("device_type", "!=", "")->get();
        $template2 = DB::table('notification_templates')->get();
        return view('admin.push_notifications', compact('result','template2'))->withPage('push_notifications')->with('sub_page', 'view-push_notifications');

view

@if(($template2))
                            @foreach($template2 as $taken)
                              
                     {{ $taken->title }}
                             
                            @endforeach
                            @endif

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

Reply to

Use Markdown with GitHub-flavored code blocks.