芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/app/Repositories/Admin/PricingPlanRepository.php
model = $pricingPlan; } /** * Get search result with paginate */ public function paginateSearchResult($search, array $sort = []): LengthAwarePaginator { $query = $this->model->with('currency')->newQuery(); // search pricing plan if (isset($search)) { $query->where('name', 'LIKE', "%$search%"); } // sort pricing plan if (isset($sort['column'])) { $query->orderBy($sort['column'], $sort['order']); } return $query->paginate(30) ->appends(array_filter([ 'search' => $search, 'sort' => $sort, ])); } /** * Create pricingPlan */ public function create(Request $request): void { // create plan $this->model->create([ 'name' => $request->input('name'), 'price' => $request->input('price'), 'currency_id' => $request->input('select_currency'), 'plan' => $request->input('plan'), 'plan_details' => json_encode($request->plan_details), ]); } /** * Update pricingPlan */ public function update(Request $request, PricingPlan $pricingPlan) { // update plan $pricingPlan->update([ 'name' => $request->input('name'), 'price' => $request->input('price'), 'currency_id' => $request->input('select_currency'), 'plan' => $request->input('plan'), 'plan_details' => json_encode($request->plan_details), ]); } /** * Delete pricingPlan */ public function destroy(PricingPlan $pricingPlan) { $pricingPlan->delete(); } /** * Bulk delete pricingPlans */ public function bulkDelete($ids): void { $idArray = explode(',', $ids); $this->model->destroy($idArray); } }