dimanche 11 octobre 2020

Laravel on form submit reload page with message and same time open a new tab with data

In laravel when a form data store in database i need reload that form with successful message and at the same time open a new tab with saved data. So how to i do this. here is my store method controller code :

    public function store(Request $request)
    {
        DB::transaction(function () use ($request) {
            $lastid = DB::table('invmaster')->pluck('id')->last()+1;
            $invdate =now()->format('ym');
            $invformate = str_pad($invdate, 9, "0", STR_PAD_RIGHT);
            $invoice_no = "DI".($invformate+$lastid);
            $invoiceMaster = InvMaster::create([
                'InvDate' => request()->input('InvDate'),
                'InvNo' => $invoice_no,
                'PatientName' => request()->input('PatientName'),
                'AdvanceAmt' => request()->input('AdvanceAmt'),
            ]);
        });
        Session::flash('message','Added  Successfully');
        return redirect('/diagnosis-invoices/create');
    } 


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3lz8Anv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire