More work on moving service updates to use components, move 'host' to 'hosting', move some redundant views

This commit is contained in:
2024-08-01 17:34:31 +10:00
parent 078dc6ab39
commit f8453ae391
18 changed files with 120 additions and 476 deletions

View File

@@ -8,7 +8,6 @@ use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Session;
@@ -18,7 +17,7 @@ use Illuminate\Validation\ValidationException;
use Illuminate\View\View;
use Symfony\Component\HttpKernel\Exception\HttpException;
use App\Http\Requests\{ChargeAdd,ServiceChangeRequest};
use App\Http\Requests\ServiceChangeRequest;
use App\Mail\{CancelRequest,ChangeRequest};
use App\Models\{Charge,Invoice,Product,Service};
@@ -274,7 +273,7 @@ class ServiceController extends Controller
*/
public function domain_list(): View
{
$o = Service\Domain::serviceActive()
$o = Service\Domain::ServiceActive()
->serviceUserAuthorised(Auth::user())
->select('service_domain.*')
->join('services',['services.id'=>'service_domain.service_id'])
@@ -287,8 +286,7 @@ class ServiceController extends Controller
public function email_list(): View
{
// @todo Need to add the with path when calculating next_billed and price
$o = Service\Email::serviceActive()
$o = Service\Email::ServiceActive()
->serviceUserAuthorised(Auth::user())
->select('service_email.*')
->join('services',['services.id'=>'service_email.service_id'])
@@ -314,15 +312,14 @@ class ServiceController extends Controller
public function hosting_list(): View
{
// @todo Need to add the with path when calculating next_billed and price
$o = Service\Host::serviceActive()
$o = Service\Host::ServiceActive()
->serviceUserAuthorised(Auth::user())
->select('service_host.*')
->join('services',['services.id'=>'service_host.service_id'])
->with(['service.account','service.product.type.supplied.supplier_detail.supplier','tld'])
->get();
return view('theme.backend.adminlte.service.host.list')
return view('theme.backend.adminlte.service.hosting.list')
->with('o',$o);
}
@@ -471,7 +468,7 @@ class ServiceController extends Controller
$o->type->save();
if ($validated->has('invoice_next_at'))
$o->invoice_next_at = $validated->get('invoice_next_at');
$o->invoice_next_at = $validated?->get('invoice_next_at');
if ($validated->has('recur_schedule'))
$o->recur_schedule = $validated->get('recur_schedule');