feat: Remove the entire frontend customer portal and its associated controllers, while updating customer repositories and adding a cache table migration.
This commit is contained in:
@@ -27,6 +27,7 @@ use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Str;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
|
||||
class CustomerController extends Controller
|
||||
@@ -120,7 +121,7 @@ class CustomerController extends Controller
|
||||
return redirect()->route('customer.index')->withErrors('No data found for this user');
|
||||
}
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
|
||||
return view("administrator.pages.customer.info", compact('customer', 'title', 'userid'));
|
||||
}
|
||||
@@ -156,7 +157,7 @@ class CustomerController extends Controller
|
||||
return redirect()->route('customer.index')->withErrors('No data found for this user');
|
||||
}
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
return view("administrator.pages.customer.profile", compact('customer', 'title', 'userid'));
|
||||
}
|
||||
|
||||
@@ -174,7 +175,7 @@ class CustomerController extends Controller
|
||||
|
||||
//validate data after validate userid
|
||||
$request->validate([
|
||||
'firstname' => 'required',
|
||||
'fullname' => 'required',
|
||||
'email' => 'required'
|
||||
]);
|
||||
//find user
|
||||
@@ -307,7 +308,7 @@ class CustomerController extends Controller
|
||||
break;
|
||||
}
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
return view(
|
||||
'administrator.pages.customer.product',
|
||||
compact(
|
||||
@@ -428,7 +429,7 @@ class CustomerController extends Controller
|
||||
['customer']
|
||||
);
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
|
||||
return view('administrator.pages.customer.domain', compact('userid', 'title', 'domains'));
|
||||
}
|
||||
@@ -461,7 +462,7 @@ class CustomerController extends Controller
|
||||
);
|
||||
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
|
||||
return view('administrator.pages.customer.invoice', compact('userid', 'title', 'invoices'));
|
||||
}
|
||||
@@ -490,7 +491,7 @@ class CustomerController extends Controller
|
||||
]
|
||||
);
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
|
||||
return view('administrator.pages.customer.transaction', compact('userid', 'title', 'transactions'));
|
||||
}
|
||||
@@ -517,7 +518,7 @@ class CustomerController extends Controller
|
||||
]
|
||||
);
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
|
||||
if (isset($request->email_id)) {
|
||||
$template = $this->mailRepository->find($request->get('email_id'));
|
||||
@@ -550,7 +551,7 @@ class CustomerController extends Controller
|
||||
'page' => $request->get('page') ?? 1
|
||||
], ['customer']);
|
||||
|
||||
$title = "#" . $customer->id . " " . $customer->firstname . " " . $customer->lastname;
|
||||
$title = "#" . $customer->id . " " . $customer->fullname;
|
||||
|
||||
return view('administrator.pages.customer.log', compact('userid', 'title', 'logs'));
|
||||
}
|
||||
@@ -726,4 +727,24 @@ class CustomerController extends Controller
|
||||
Auth::guard('users')->logout();
|
||||
return redirect()->route('customer.index');
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$query = $this->customerRepository->filter(
|
||||
$request->all(),
|
||||
[],
|
||||
['hosting', 'vps', 'domain'],
|
||||
['*'],
|
||||
true
|
||||
);
|
||||
|
||||
return DataTables::eloquent($query)
|
||||
->addColumn(
|
||||
'action',
|
||||
function ($d) {
|
||||
return view('administrator.pages.customer.datatable.action', ['row' => $d])->render();
|
||||
}
|
||||
)
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user