Answers for "route edit button in laravel ajax"

0

route edit button in laravel ajax

public function getJobs()
    {
        return datatables()->of(Jobs::latest()->get())
            ->addColumn('action', function ($jobs) {
                $button = '<div class="btn-group btn-group-xs">';
                $button .= '<a href="/jobs/' . $jobs->id . '/edit" class="btn btn-primary btn-xs"><i class="fa fa-edit fa-fw"></i> Edit</a>';
                $button .= '<button type="button" name="deleteButton" id="' . $jobs->id . '" class="btn btn-danger btn-xs deleteButton"><i class="fas fa-trash-alt"></i> Delete</button>';
                $button .= '</div>';
                return $button;
            })
            ->rawColumns(['action'])
            ->make(true);
    }

    public function destroy($id)
    {
        Jobs::find($id)->delete();
    }
Posted by: Guest on July-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language