mirror of
				https://github.com/cp6/my-idlers.git
				synced 2025-10-30 22:09:10 +00:00 
			
		
		
		
	V2 (Laravel re-make)
V2 (Laravel re-make)
This commit is contained in:
		
							parent
							
								
									91928b6d54
								
							
						
					
					
						commit
						fd22b0bf58
					
				
					 9702 changed files with 1001586 additions and 15234 deletions
				
			
		
							
								
								
									
										8
									
								
								.idea/.gitignore
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								.idea/.gitignore
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,8 @@ | |||
| # Default ignored files | ||||
| /shelf/ | ||||
| /workspace.xml | ||||
| # Editor-based HTTP Client requests | ||||
| /httpRequests/ | ||||
| # Datasource local storage ignored files | ||||
| /dataSources/ | ||||
| /dataSources.local.xml | ||||
							
								
								
									
										101
									
								
								.idea/blade.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								.idea/blade.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,101 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="BladeInjectionConfiguration" default="false"> | ||||
|     <directives> | ||||
|       <data directive="@append" /> | ||||
|       <data directive="@auth" injection="true" prefix="<?php if(auth()->guard(" suffix=")->check()): ?>" /> | ||||
|       <data directive="@aware" injection="true" prefix="<?php $attributes = $attributes->exceptProps(" suffix="); ?>" /> | ||||
|       <data directive="@break" injection="true" prefix="<?php if(" suffix=") break; ?>" /> | ||||
|       <data directive="@can" injection="true" prefix="<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check(" suffix=")): ?>" /> | ||||
|       <data directive="@canany" injection="true" prefix="<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(" suffix=")): ?>" /> | ||||
|       <data directive="@cannot" injection="true" prefix="<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->denies(" suffix=")): ?>" /> | ||||
|       <data directive="@case" injection="true" prefix="<?php case (" suffix="): ?>" /> | ||||
|       <data directive="@checked" injection="true" prefix="<?php if(" suffix=") {echo 'checked';}?>" /> | ||||
|       <data directive="@choice" injection="true" prefix="<?php echo app('translator')->choice(" suffix="); ?>" /> | ||||
|       <data directive="@class" injection="true" prefix="class="<?php echo \Illuminate\Support\Arr::toCssClasses(" suffix=")?>"" /> | ||||
|       <data directive="@component" injection="true" prefix="<?php $__env->startComponent(" suffix="); ?>" /> | ||||
|       <data directive="@componentfirst" injection="true" prefix="<?php $__env->startComponentFirst(" suffix="); ?>" /> | ||||
|       <data directive="@continue" injection="true" prefix="<?php if(" suffix=") continue; ?>" /> | ||||
|       <data directive="@csrf" /> | ||||
|       <data directive="@dd" injection="true" prefix="<?php dd(" suffix="); ?>" /> | ||||
|       <data directive="@default" /> | ||||
|       <data directive="@dump" injection="true" prefix="<?php dump(" suffix="); ?>" /> | ||||
|       <data directive="@each" injection="true" prefix="<?php echo $__env->renderEach(" suffix="); ?>" /> | ||||
|       <data directive="@else" /> | ||||
|       <data directive="@elseauth" injection="true" prefix="<?php elseif(auth()->guard(" suffix=")->check()): ?>" /> | ||||
|       <data directive="@elsecan" injection="true" prefix="<?php elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check(" suffix=")): ?>" /> | ||||
|       <data directive="@elsecanany" injection="true" prefix="<?php elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(" suffix=")): ?>" /> | ||||
|       <data directive="@elsecannot" injection="true" prefix="<?php elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)->denies(" suffix=")): ?>" /> | ||||
|       <data directive="@elseguest" injection="true" prefix="<?php elseif(auth()->guard(" suffix=")->guest()): ?>" /> | ||||
|       <data directive="@elseif" injection="true" prefix="<?php elseif(" suffix="): ?>" /> | ||||
|       <data directive="@empty" injection="true" prefix="<?php if(empty(" suffix=")): ?>" /> | ||||
|       <data directive="@endauth" /> | ||||
|       <data directive="@endcan" /> | ||||
|       <data directive="@endcanany" /> | ||||
|       <data directive="@endcannot" /> | ||||
|       <data directive="@endcomponent" /> | ||||
|       <data directive="@endcomponentClass" /> | ||||
|       <data directive="@endcomponentfirst" /> | ||||
|       <data directive="@endempty" /> | ||||
|       <data directive="@endenv" /> | ||||
|       <data directive="@enderror" /> | ||||
|       <data directive="@endfor" /> | ||||
|       <data directive="@endforeach" /> | ||||
|       <data directive="@endforelse" /> | ||||
|       <data directive="@endguest" /> | ||||
|       <data directive="@endif" /> | ||||
|       <data directive="@endisset" /> | ||||
|       <data directive="@endlang" /> | ||||
|       <data directive="@endonce" /> | ||||
|       <data directive="@endphp" /> | ||||
|       <data directive="@endprepend" /> | ||||
|       <data directive="@endproduction" /> | ||||
|       <data directive="@endpush" /> | ||||
|       <data directive="@endsection" /> | ||||
|       <data directive="@endslot" /> | ||||
|       <data directive="@endswitch" /> | ||||
|       <data directive="@endunless" /> | ||||
|       <data directive="@endverbatim" /> | ||||
|       <data directive="@endwhile" /> | ||||
|       <data directive="@env" injection="true" prefix="<?php if(app()->environment(" suffix=")): ?>" /> | ||||
|       <data directive="@error" injection="true" prefix="<?php $__errorArgs = [" suffix="];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>" /> | ||||
|       <data directive="@extends" injection="true" prefix="<?php echo $__env->make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" /> | ||||
|       <data directive="@extendsfirst" injection="true" prefix="<?php echo $__env->first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" /> | ||||
|       <data directive="@for" injection="true" prefix="<?php for(" suffix="): ?>" /> | ||||
|       <data directive="@foreach" injection="true" prefix="<?php foreach(" suffix="): ?>" /> | ||||
|       <data directive="@forelse" injection="true" prefix="<?php foreach(" suffix="): ?>" /> | ||||
|       <data directive="@guest" injection="true" prefix="<?php if(auth()->guard(" suffix=")->guest()): ?>" /> | ||||
|       <data directive="@hasSection" injection="true" prefix="<?php if (! empty(trim($__env->yieldContent(" suffix=")))): ?>" /> | ||||
|       <data directive="@if" injection="true" prefix="<?php if(" suffix="): ?>" /> | ||||
|       <data directive="@include" injection="true" prefix="<?php echo $__env->make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" /> | ||||
|       <data directive="@includeFirst" injection="true" prefix="<?php echo $__env->first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" /> | ||||
|       <data directive="@includeUnless" injection="true" prefix="<?php echo $__env->renderWhen(! " suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>" /> | ||||
|       <data directive="@includeWhen" injection="true" prefix="<?php echo $__env->renderWhen(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>" /> | ||||
|       <data directive="@isset" injection="true" prefix="<?php if(isset(" suffix=")): ?>" /> | ||||
|       <data directive="@json" injection="true" prefix="<?php echo json_encode(" suffix=") ?>" /> | ||||
|       <data directive="@lang" injection="true" prefix="<?php echo app('translator')->get(" suffix="); ?>" /> | ||||
|       <data directive="@method" injection="true" prefix="<?php echo method_field(" suffix="); ?>" /> | ||||
|       <data directive="@once" /> | ||||
|       <data directive="@overwrite" /> | ||||
|       <data directive="@parent" /> | ||||
|       <data directive="@php" injection="true" prefix="<?php (" suffix="); ?>" /> | ||||
|       <data directive="@prepend" injection="true" prefix="<?php $__env->startPrepend(" suffix="); ?>" /> | ||||
|       <data directive="@production" /> | ||||
|       <data directive="@props" injection="true" prefix="<?php $attributes = $attributes->exceptProps(" suffix="); ?>" /> | ||||
|       <data directive="@push" injection="true" prefix="<?php $__env->startPush(" suffix="); ?>" /> | ||||
|       <data directive="@section" injection="true" prefix="<?php $__env->startSection(" suffix="); ?>" /> | ||||
|       <data directive="@sectionMissing" injection="true" prefix="<?php if (empty(trim($__env->yieldContent(" suffix=")))): ?>" /> | ||||
|       <data directive="@selected" injection="true" prefix="<?php if(" suffix=") {echo 'selected';}?>" /> | ||||
|       <data directive="@show" /> | ||||
|       <data directive="@slot" injection="true" prefix="<?php $__env->slot(" suffix="); ?>" /> | ||||
|       <data directive="@stack" injection="true" prefix="<?php echo $__env->yieldPushContent(" suffix="); ?>" /> | ||||
|       <data directive="@stop" /> | ||||
|       <data directive="@switch" injection="true" prefix="<?php switch(" suffix="): ?>" /> | ||||
|       <data directive="@unless" injection="true" prefix="<?php if (! (" suffix=")): ?>" /> | ||||
|       <data directive="@unset" injection="true" prefix="<?php unset(" suffix="); ?>" /> | ||||
|       <data directive="@verbatim" /> | ||||
|       <data directive="@while" injection="true" prefix="<?php while(" suffix="): ?>" /> | ||||
|       <data directive="@yield" injection="true" prefix="<?php echo $__env->yieldContent(" suffix="); ?>" /> | ||||
|     </directives> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										3490
									
								
								.idea/commandlinetools/Laravel_1_30_22__1_00_PM.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										3490
									
								
								.idea/commandlinetools/Laravel_1_30_22__1_00_PM.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										47
									
								
								.idea/commandlinetools/schemas/frameworkDescriptionVersion1.1.4.xsd
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								.idea/commandlinetools/schemas/frameworkDescriptionVersion1.1.4.xsd
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,47 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" | ||||
|            xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||||
|   <xs:element name="framework" type="frameworkType"/> | ||||
|   <xs:complexType name="commandType"> | ||||
|     <xs:all> | ||||
|       <xs:element type="xs:string" name="name" minOccurs="1" maxOccurs="1"/> | ||||
|       <xs:element type="xs:string" name="params" minOccurs="0" maxOccurs="1"/> | ||||
|       <xs:element type="xs:string" name="help" minOccurs="0" maxOccurs="1"/> | ||||
|       <xs:element type="optionsBeforeType" name="optionsBefore" minOccurs="0" maxOccurs="1"/> | ||||
|     </xs:all> | ||||
|   </xs:complexType> | ||||
|   <xs:complexType name="frameworkType"> | ||||
|     <xs:sequence> | ||||
|       <xs:element type="xs:string" name="extraData" minOccurs="0" maxOccurs="1"/> | ||||
|       <xs:element type="commandType" name="command" maxOccurs="unbounded" minOccurs="0"/> | ||||
|       <xs:element type="xs:string" name="help" minOccurs="0" maxOccurs="1"/> | ||||
|     </xs:sequence> | ||||
|     <xs:attribute type="xs:string" name="name" use="required"/> | ||||
|     <xs:attribute type="xs:string" name="invoke" use="required"/> | ||||
|     <xs:attribute type="xs:string" name="alias" use="required"/> | ||||
|     <xs:attribute type="xs:boolean" name="enabled" use="required"/> | ||||
|     <xs:attribute type="xs:integer" name="version" use="required"/> | ||||
|     <xs:attribute type="xs:string" name="frameworkId" use="optional"/> | ||||
|   </xs:complexType> | ||||
|   <xs:complexType name="optionsBeforeType"> | ||||
|     <xs:sequence> | ||||
|       <xs:element type="optionType" name="option" maxOccurs="unbounded" minOccurs="0"/> | ||||
|     </xs:sequence> | ||||
|   </xs:complexType> | ||||
|   <xs:complexType name="optionType"> | ||||
|     <xs:sequence> | ||||
|       <xs:element type="xs:string" name="help" minOccurs="0" maxOccurs="1"/> | ||||
|     </xs:sequence> | ||||
|     <xs:attribute type="xs:string" name="name" use="required"/> | ||||
|     <xs:attribute type="xs:string" name="shortcut" use="optional"/> | ||||
|     <xs:attribute name="pattern" use="optional"> | ||||
|       <xs:simpleType> | ||||
|         <xs:restriction base="xs:string"> | ||||
|              <xs:enumeration value="space"/> | ||||
|              <xs:enumeration value="equals"/> | ||||
|              <xs:enumeration value="unknown"/> | ||||
|            </xs:restriction> | ||||
|       </xs:simpleType> | ||||
|     </xs:attribute> | ||||
|   </xs:complexType> | ||||
| </xs:schema> | ||||
							
								
								
									
										12
									
								
								.idea/dataSources.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								.idea/dataSources.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="DataSourceManagerImpl" format="xml" multifile-model="true"> | ||||
|     <data-source source="LOCAL" name="my_idlers@localhost" uuid="efc7de96-2071-4420-9d95-422a64f97449"> | ||||
|       <driver-ref>mysql.8</driver-ref> | ||||
|       <synchronize>true</synchronize> | ||||
|       <jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver> | ||||
|       <jdbc-url>jdbc:mysql://localhost:3306/my_idlers</jdbc-url> | ||||
|       <working-dir>$ProjectFileDir$</working-dir> | ||||
|     </data-source> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										459
									
								
								.idea/dbnavigator.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										459
									
								
								.idea/dbnavigator.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,459 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="DBNavigator.Project.DataEditorManager"> | ||||
|     <record-view-column-sorting-type value="BY_INDEX" /> | ||||
|     <value-preview-text-wrapping value="true" /> | ||||
|     <value-preview-pinned value="false" /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.DataExportManager"> | ||||
|     <export-instructions> | ||||
|       <create-header value="true" /> | ||||
|       <friendly-headers value="false" /> | ||||
|       <quote-values-containing-separator value="true" /> | ||||
|       <quote-all-values value="false" /> | ||||
|       <value-separator value="" /> | ||||
|       <file-name value="" /> | ||||
|       <file-location value="" /> | ||||
|       <scope value="GLOBAL" /> | ||||
|       <destination value="FILE" /> | ||||
|       <format value="EXCEL" /> | ||||
|       <charset value="windows-1252" /> | ||||
|     </export-instructions> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.DatabaseBrowserManager"> | ||||
|     <autoscroll-to-editor value="false" /> | ||||
|     <autoscroll-from-editor value="true" /> | ||||
|     <show-object-properties value="true" /> | ||||
|     <loaded-nodes /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.DatabaseFileManager"> | ||||
|     <open-files /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.EditorStateManager"> | ||||
|     <last-used-providers /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.ExecutionManager"> | ||||
|     <retain-sticky-names value="false" /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.MethodExecutionManager"> | ||||
|     <method-browser /> | ||||
|     <execution-history> | ||||
|       <group-entries value="true" /> | ||||
|       <execution-inputs /> | ||||
|     </execution-history> | ||||
|     <argument-values-cache /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.ObjectDependencyManager"> | ||||
|     <last-used-dependency-type value="INCOMING" /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.ObjectQuickFilterManager"> | ||||
|     <last-used-operator value="EQUAL" /> | ||||
|     <filters /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.ParserDiagnosticsManager"> | ||||
|     <diagnostics-history /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true"> | ||||
|     <recently-used-interfaces /> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.Settings"> | ||||
|     <connections /> | ||||
|     <browser-settings> | ||||
|       <general> | ||||
|         <display-mode value="TABBED" /> | ||||
|         <navigation-history-size value="100" /> | ||||
|         <show-object-details value="false" /> | ||||
|       </general> | ||||
|       <filters> | ||||
|         <object-type-filter> | ||||
|           <object-type name="SCHEMA" enabled="true" /> | ||||
|           <object-type name="USER" enabled="true" /> | ||||
|           <object-type name="ROLE" enabled="true" /> | ||||
|           <object-type name="PRIVILEGE" enabled="true" /> | ||||
|           <object-type name="CHARSET" enabled="true" /> | ||||
|           <object-type name="TABLE" enabled="true" /> | ||||
|           <object-type name="VIEW" enabled="true" /> | ||||
|           <object-type name="MATERIALIZED_VIEW" enabled="true" /> | ||||
|           <object-type name="NESTED_TABLE" enabled="true" /> | ||||
|           <object-type name="COLUMN" enabled="true" /> | ||||
|           <object-type name="INDEX" enabled="true" /> | ||||
|           <object-type name="CONSTRAINT" enabled="true" /> | ||||
|           <object-type name="DATASET_TRIGGER" enabled="true" /> | ||||
|           <object-type name="DATABASE_TRIGGER" enabled="true" /> | ||||
|           <object-type name="SYNONYM" enabled="true" /> | ||||
|           <object-type name="SEQUENCE" enabled="true" /> | ||||
|           <object-type name="PROCEDURE" enabled="true" /> | ||||
|           <object-type name="FUNCTION" enabled="true" /> | ||||
|           <object-type name="PACKAGE" enabled="true" /> | ||||
|           <object-type name="TYPE" enabled="true" /> | ||||
|           <object-type name="TYPE_ATTRIBUTE" enabled="true" /> | ||||
|           <object-type name="ARGUMENT" enabled="true" /> | ||||
|           <object-type name="DIMENSION" enabled="true" /> | ||||
|           <object-type name="CLUSTER" enabled="true" /> | ||||
|           <object-type name="DBLINK" enabled="true" /> | ||||
|         </object-type-filter> | ||||
|       </filters> | ||||
|       <sorting> | ||||
|         <object-type name="COLUMN" sorting-type="NAME" /> | ||||
|         <object-type name="FUNCTION" sorting-type="NAME" /> | ||||
|         <object-type name="PROCEDURE" sorting-type="NAME" /> | ||||
|         <object-type name="ARGUMENT" sorting-type="POSITION" /> | ||||
|       </sorting> | ||||
|       <default-editors> | ||||
|         <object-type name="VIEW" editor-type="SELECTION" /> | ||||
|         <object-type name="PACKAGE" editor-type="SELECTION" /> | ||||
|         <object-type name="TYPE" editor-type="SELECTION" /> | ||||
|       </default-editors> | ||||
|     </browser-settings> | ||||
|     <navigation-settings> | ||||
|       <lookup-filters> | ||||
|         <lookup-objects> | ||||
|           <object-type name="SCHEMA" enabled="true" /> | ||||
|           <object-type name="USER" enabled="false" /> | ||||
|           <object-type name="ROLE" enabled="false" /> | ||||
|           <object-type name="PRIVILEGE" enabled="false" /> | ||||
|           <object-type name="CHARSET" enabled="false" /> | ||||
|           <object-type name="TABLE" enabled="true" /> | ||||
|           <object-type name="VIEW" enabled="true" /> | ||||
|           <object-type name="MATERIALIZED VIEW" enabled="true" /> | ||||
|           <object-type name="INDEX" enabled="true" /> | ||||
|           <object-type name="CONSTRAINT" enabled="true" /> | ||||
|           <object-type name="DATASET TRIGGER" enabled="true" /> | ||||
|           <object-type name="DATABASE TRIGGER" enabled="true" /> | ||||
|           <object-type name="SYNONYM" enabled="false" /> | ||||
|           <object-type name="SEQUENCE" enabled="true" /> | ||||
|           <object-type name="PROCEDURE" enabled="true" /> | ||||
|           <object-type name="FUNCTION" enabled="true" /> | ||||
|           <object-type name="PACKAGE" enabled="true" /> | ||||
|           <object-type name="TYPE" enabled="true" /> | ||||
|           <object-type name="DIMENSION" enabled="false" /> | ||||
|           <object-type name="CLUSTER" enabled="false" /> | ||||
|           <object-type name="DBLINK" enabled="true" /> | ||||
|         </lookup-objects> | ||||
|         <force-database-load value="false" /> | ||||
|         <prompt-connection-selection value="true" /> | ||||
|         <prompt-schema-selection value="true" /> | ||||
|       </lookup-filters> | ||||
|     </navigation-settings> | ||||
|     <dataset-grid-settings> | ||||
|       <general> | ||||
|         <enable-zooming value="true" /> | ||||
|         <enable-column-tooltip value="true" /> | ||||
|       </general> | ||||
|       <sorting> | ||||
|         <nulls-first value="true" /> | ||||
|         <max-sorting-columns value="4" /> | ||||
|       </sorting> | ||||
|       <tracking-columns> | ||||
|         <columnNames value="" /> | ||||
|         <visible value="true" /> | ||||
|         <editable value="false" /> | ||||
|       </tracking-columns> | ||||
|     </dataset-grid-settings> | ||||
|     <dataset-editor-settings> | ||||
|       <text-editor-popup> | ||||
|         <active value="false" /> | ||||
|         <active-if-empty value="false" /> | ||||
|         <data-length-threshold value="100" /> | ||||
|         <popup-delay value="1000" /> | ||||
|       </text-editor-popup> | ||||
|       <values-actions-popup> | ||||
|         <show-popup-button value="true" /> | ||||
|         <element-count-threshold value="1000" /> | ||||
|         <data-length-threshold value="250" /> | ||||
|       </values-actions-popup> | ||||
|       <general> | ||||
|         <fetch-block-size value="100" /> | ||||
|         <fetch-timeout value="30" /> | ||||
|         <trim-whitespaces value="true" /> | ||||
|         <convert-empty-strings-to-null value="true" /> | ||||
|         <select-content-on-cell-edit value="true" /> | ||||
|         <large-value-preview-active value="true" /> | ||||
|       </general> | ||||
|       <filters> | ||||
|         <prompt-filter-dialog value="true" /> | ||||
|         <default-filter-type value="BASIC" /> | ||||
|       </filters> | ||||
|       <qualified-text-editor text-length-threshold="300"> | ||||
|         <content-types> | ||||
|           <content-type name="Text" enabled="true" /> | ||||
|           <content-type name="XML" enabled="true" /> | ||||
|           <content-type name="DTD" enabled="true" /> | ||||
|           <content-type name="HTML" enabled="true" /> | ||||
|           <content-type name="XHTML" enabled="true" /> | ||||
|           <content-type name="CSS" enabled="true" /> | ||||
|           <content-type name="SQL" enabled="true" /> | ||||
|           <content-type name="PL/SQL" enabled="true" /> | ||||
|           <content-type name="JavaScript" enabled="true" /> | ||||
|           <content-type name="JSON" enabled="true" /> | ||||
|           <content-type name="JSON5" enabled="true" /> | ||||
|           <content-type name="PHP" enabled="true" /> | ||||
|           <content-type name="YAML" enabled="true" /> | ||||
|         </content-types> | ||||
|       </qualified-text-editor> | ||||
|       <record-navigation> | ||||
|         <navigation-target value="VIEWER" /> | ||||
|       </record-navigation> | ||||
|     </dataset-editor-settings> | ||||
|     <code-editor-settings> | ||||
|       <general> | ||||
|         <show-object-navigation-gutter value="false" /> | ||||
|         <show-spec-declaration-navigation-gutter value="true" /> | ||||
|         <enable-spellchecking value="true" /> | ||||
|         <enable-reference-spellchecking value="false" /> | ||||
|       </general> | ||||
|       <confirmations> | ||||
|         <save-changes value="false" /> | ||||
|         <revert-changes value="true" /> | ||||
|       </confirmations> | ||||
|     </code-editor-settings> | ||||
|     <code-completion-settings> | ||||
|       <filters> | ||||
|         <basic-filter> | ||||
|           <filter-element type="RESERVED_WORD" id="keyword" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="function" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="parameter" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="datatype" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="exception" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="schema" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="role" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="user" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="privilege" selected="true" /> | ||||
|           <user-schema> | ||||
|             <filter-element type="OBJECT" id="table" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="materialized view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="index" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="constraint" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="trigger" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="synonym" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="sequence" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="procedure" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="function" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="package" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="type" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dimension" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="cluster" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dblink" selected="true" /> | ||||
|           </user-schema> | ||||
|           <public-schema> | ||||
|             <filter-element type="OBJECT" id="table" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="view" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="materialized view" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="index" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="constraint" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="trigger" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="synonym" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="sequence" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="procedure" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="function" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="package" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="type" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="dimension" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="cluster" selected="false" /> | ||||
|             <filter-element type="OBJECT" id="dblink" selected="false" /> | ||||
|           </public-schema> | ||||
|           <any-schema> | ||||
|             <filter-element type="OBJECT" id="table" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="materialized view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="index" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="constraint" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="trigger" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="synonym" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="sequence" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="procedure" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="function" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="package" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="type" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dimension" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="cluster" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dblink" selected="true" /> | ||||
|           </any-schema> | ||||
|         </basic-filter> | ||||
|         <extended-filter> | ||||
|           <filter-element type="RESERVED_WORD" id="keyword" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="function" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="parameter" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="datatype" selected="true" /> | ||||
|           <filter-element type="RESERVED_WORD" id="exception" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="schema" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="user" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="role" selected="true" /> | ||||
|           <filter-element type="OBJECT" id="privilege" selected="true" /> | ||||
|           <user-schema> | ||||
|             <filter-element type="OBJECT" id="table" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="materialized view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="index" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="constraint" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="trigger" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="synonym" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="sequence" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="procedure" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="function" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="package" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="type" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dimension" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="cluster" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dblink" selected="true" /> | ||||
|           </user-schema> | ||||
|           <public-schema> | ||||
|             <filter-element type="OBJECT" id="table" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="materialized view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="index" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="constraint" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="trigger" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="synonym" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="sequence" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="procedure" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="function" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="package" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="type" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dimension" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="cluster" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dblink" selected="true" /> | ||||
|           </public-schema> | ||||
|           <any-schema> | ||||
|             <filter-element type="OBJECT" id="table" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="materialized view" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="index" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="constraint" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="trigger" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="synonym" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="sequence" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="procedure" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="function" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="package" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="type" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dimension" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="cluster" selected="true" /> | ||||
|             <filter-element type="OBJECT" id="dblink" selected="true" /> | ||||
|           </any-schema> | ||||
|         </extended-filter> | ||||
|       </filters> | ||||
|       <sorting enabled="true"> | ||||
|         <sorting-element type="RESERVED_WORD" id="keyword" /> | ||||
|         <sorting-element type="RESERVED_WORD" id="datatype" /> | ||||
|         <sorting-element type="OBJECT" id="column" /> | ||||
|         <sorting-element type="OBJECT" id="table" /> | ||||
|         <sorting-element type="OBJECT" id="view" /> | ||||
|         <sorting-element type="OBJECT" id="materialized view" /> | ||||
|         <sorting-element type="OBJECT" id="index" /> | ||||
|         <sorting-element type="OBJECT" id="constraint" /> | ||||
|         <sorting-element type="OBJECT" id="trigger" /> | ||||
|         <sorting-element type="OBJECT" id="synonym" /> | ||||
|         <sorting-element type="OBJECT" id="sequence" /> | ||||
|         <sorting-element type="OBJECT" id="procedure" /> | ||||
|         <sorting-element type="OBJECT" id="function" /> | ||||
|         <sorting-element type="OBJECT" id="package" /> | ||||
|         <sorting-element type="OBJECT" id="type" /> | ||||
|         <sorting-element type="OBJECT" id="dimension" /> | ||||
|         <sorting-element type="OBJECT" id="cluster" /> | ||||
|         <sorting-element type="OBJECT" id="dblink" /> | ||||
|         <sorting-element type="OBJECT" id="schema" /> | ||||
|         <sorting-element type="OBJECT" id="role" /> | ||||
|         <sorting-element type="OBJECT" id="user" /> | ||||
|         <sorting-element type="RESERVED_WORD" id="function" /> | ||||
|         <sorting-element type="RESERVED_WORD" id="parameter" /> | ||||
|       </sorting> | ||||
|       <format> | ||||
|         <enforce-code-style-case value="true" /> | ||||
|       </format> | ||||
|     </code-completion-settings> | ||||
|     <execution-engine-settings> | ||||
|       <statement-execution> | ||||
|         <fetch-block-size value="100" /> | ||||
|         <execution-timeout value="20" /> | ||||
|         <debug-execution-timeout value="600" /> | ||||
|         <focus-result value="false" /> | ||||
|         <prompt-execution value="false" /> | ||||
|       </statement-execution> | ||||
|       <script-execution> | ||||
|         <command-line-interfaces /> | ||||
|         <execution-timeout value="300" /> | ||||
|       </script-execution> | ||||
|       <method-execution> | ||||
|         <execution-timeout value="30" /> | ||||
|         <debug-execution-timeout value="600" /> | ||||
|         <parameter-history-size value="10" /> | ||||
|       </method-execution> | ||||
|     </execution-engine-settings> | ||||
|     <operation-settings> | ||||
|       <transactions> | ||||
|         <uncommitted-changes> | ||||
|           <on-project-close value="ASK" /> | ||||
|           <on-disconnect value="ASK" /> | ||||
|           <on-autocommit-toggle value="ASK" /> | ||||
|         </uncommitted-changes> | ||||
|         <multiple-uncommitted-changes> | ||||
|           <on-commit value="ASK" /> | ||||
|           <on-rollback value="ASK" /> | ||||
|         </multiple-uncommitted-changes> | ||||
|       </transactions> | ||||
|       <session-browser> | ||||
|         <disconnect-session value="ASK" /> | ||||
|         <kill-session value="ASK" /> | ||||
|         <reload-on-filter-change value="false" /> | ||||
|       </session-browser> | ||||
|       <compiler> | ||||
|         <compile-type value="KEEP" /> | ||||
|         <compile-dependencies value="ASK" /> | ||||
|         <always-show-controls value="false" /> | ||||
|       </compiler> | ||||
|       <debugger> | ||||
|         <debugger-type value="JDBC" /> | ||||
|         <use-generic-runners value="true" /> | ||||
|       </debugger> | ||||
|     </operation-settings> | ||||
|     <ddl-file-settings> | ||||
|       <extensions> | ||||
|         <mapping file-type-id="VIEW" extensions="vw" /> | ||||
|         <mapping file-type-id="TRIGGER" extensions="trg" /> | ||||
|         <mapping file-type-id="PROCEDURE" extensions="prc" /> | ||||
|         <mapping file-type-id="FUNCTION" extensions="fnc" /> | ||||
|         <mapping file-type-id="PACKAGE" extensions="pkg" /> | ||||
|         <mapping file-type-id="PACKAGE_SPEC" extensions="pks" /> | ||||
|         <mapping file-type-id="PACKAGE_BODY" extensions="pkb" /> | ||||
|         <mapping file-type-id="TYPE" extensions="tpe" /> | ||||
|         <mapping file-type-id="TYPE_SPEC" extensions="tps" /> | ||||
|         <mapping file-type-id="TYPE_BODY" extensions="tpb" /> | ||||
|       </extensions> | ||||
|       <general> | ||||
|         <lookup-ddl-files value="true" /> | ||||
|         <create-ddl-files value="false" /> | ||||
|         <synchronize-ddl-files value="true" /> | ||||
|         <use-qualified-names value="false" /> | ||||
|         <make-scripts-rerunnable value="true" /> | ||||
|       </general> | ||||
|     </ddl-file-settings> | ||||
|     <general-settings> | ||||
|       <regional-settings> | ||||
|         <date-format value="MEDIUM" /> | ||||
|         <number-format value="UNGROUPED" /> | ||||
|         <locale value="SYSTEM_DEFAULT" /> | ||||
|         <use-custom-formats value="false" /> | ||||
|       </regional-settings> | ||||
|       <environment> | ||||
|         <environment-types> | ||||
|           <environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" /> | ||||
|           <environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" /> | ||||
|           <environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" /> | ||||
|           <environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" /> | ||||
|         </environment-types> | ||||
|         <visibility-settings> | ||||
|           <connection-tabs value="true" /> | ||||
|           <dialog-headers value="true" /> | ||||
|           <object-editor-tabs value="true" /> | ||||
|           <script-editor-tabs value="false" /> | ||||
|           <execution-result-tabs value="true" /> | ||||
|         </visibility-settings> | ||||
|       </environment> | ||||
|     </general-settings> | ||||
|   </component> | ||||
|   <component name="DBNavigator.Project.StatementExecutionManager"> | ||||
|     <execution-variables /> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										70
									
								
								.idea/deployment.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								.idea/deployment.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,70 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false"> | ||||
|     <serverData> | ||||
|       <paths name="api.nbastatr.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="api.srv3r.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="au2.srv3r.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="be1.nbastatr.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="dal.srv3r.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="los.srv3r.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="mel.srv3r.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="pearl.srv3r.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|       <paths name="q.srv3r.com"> | ||||
|         <serverdata> | ||||
|           <mappings> | ||||
|             <mapping local="$PROJECT_DIR$" web="/" /> | ||||
|           </mappings> | ||||
|         </serverdata> | ||||
|       </paths> | ||||
|     </serverData> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										131
									
								
								.idea/idlers.iml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										131
									
								
								.idea/idlers.iml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,131 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <module type="WEB_MODULE" version="4"> | ||||
|   <component name="NewModuleRootManager"> | ||||
|     <content url="file://$MODULE_DIR$"> | ||||
|       <sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" /> | ||||
|       <sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" /> | ||||
|       <sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" /> | ||||
|       <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" /> | ||||
|       <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" /> | ||||
|       <sourceFolder url="file://$MODULE_DIR$/tests/Feature" isTestSource="true" /> | ||||
|       <sourceFolder url="file://$MODULE_DIR$/tests/Unit" isTestSource="true" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/uuid" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/collection" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/laravel/framework" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/laravel/serializable-closure" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/laravel/tinker" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/laravel/breeze" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/laravel/sail" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/fakerphp/faker" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/facade/ignition-contracts" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/fruitcake/laravel-cors" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/league/mime-type-detection" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/league/commonmark" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/league/config" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psy/psysh" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/voku/portable-ascii" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/nette/utils" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/nette/schema" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/dflydev/dot-access-data" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/brick/math" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/asm89/stack-cors" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/tijsverkoyen/css-to-inline-styles" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/css-selector" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/error-handler" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/dragonmantank/cron-expression" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php81" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/composer" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-ignition" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/spatie/ignition" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/spatie/flare-client-php" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/spatie/backtrace" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/laravel/ui" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/storage/app" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/storage/framework" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/_laravel_idea" /> | ||||
|       <excludeFolder url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" /> | ||||
|     </content> | ||||
|     <orderEntry type="inheritedJdk" /> | ||||
|     <orderEntry type="sourceFolder" forTests="false" /> | ||||
|   </component> | ||||
| </module> | ||||
							
								
								
									
										166
									
								
								.idea/inspectionProfiles/Project_Default.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										166
									
								
								.idea/inspectionProfiles/Project_Default.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,166 @@ | |||
| <component name="InspectionProjectProfileManager"> | ||||
|   <profile version="1.0"> | ||||
|     <option name="myName" value="Project Default" /> | ||||
|     <inspection_tool class="ForgottenDebugOutputInspection" enabled="true" level="ERROR" enabled_by_default="true"> | ||||
|       <option name="configuration"> | ||||
|         <list> | ||||
|           <option value="\Codeception\Util\Debug::debug" /> | ||||
|           <option value="\Codeception\Util\Debug::pause" /> | ||||
|           <option value="\Doctrine\Common\Util\Debug::dump" /> | ||||
|           <option value="\Doctrine\Common\Util\Debug::export" /> | ||||
|           <option value="\Illuminate\Support\Debug\Dumper::dump" /> | ||||
|           <option value="\Symfony\Component\Debug\Debug::enable" /> | ||||
|           <option value="\Symfony\Component\Debug\DebugClassLoader::enable" /> | ||||
|           <option value="\Symfony\Component\Debug\ErrorHandler::register" /> | ||||
|           <option value="\Symfony\Component\Debug\ExceptionHandler::register" /> | ||||
|           <option value="\TYPO3\CMS\Core\Utility\DebugUtility::debug" /> | ||||
|           <option value="\Zend\Debug\Debug::dump" /> | ||||
|           <option value="\Zend\Di\Display\Console::export" /> | ||||
|           <option value="dd" /> | ||||
|           <option value="debug_print_backtrace" /> | ||||
|           <option value="debug_zval_dump" /> | ||||
|           <option value="dpm" /> | ||||
|           <option value="dpq" /> | ||||
|           <option value="dsm" /> | ||||
|           <option value="dump" /> | ||||
|           <option value="dvm" /> | ||||
|           <option value="error_log" /> | ||||
|           <option value="kpr" /> | ||||
|           <option value="phpinfo" /> | ||||
|           <option value="print_r" /> | ||||
|           <option value="var_dump" /> | ||||
|           <option value="var_export" /> | ||||
|           <option value="wp_die" /> | ||||
|           <option value="xdebug_break" /> | ||||
|           <option value="xdebug_call_class" /> | ||||
|           <option value="xdebug_call_file" /> | ||||
|           <option value="xdebug_call_function" /> | ||||
|           <option value="xdebug_call_line" /> | ||||
|           <option value="xdebug_code_coverage_started" /> | ||||
|           <option value="xdebug_debug_zval" /> | ||||
|           <option value="xdebug_debug_zval_stdout" /> | ||||
|           <option value="xdebug_dump_superglobals" /> | ||||
|           <option value="xdebug_enable" /> | ||||
|           <option value="xdebug_get_code_coverage" /> | ||||
|           <option value="xdebug_get_collected_errors" /> | ||||
|           <option value="xdebug_get_declared_vars" /> | ||||
|           <option value="xdebug_get_function_stack" /> | ||||
|           <option value="xdebug_get_headers" /> | ||||
|           <option value="xdebug_get_monitored_functions" /> | ||||
|           <option value="xdebug_get_profiler_filename" /> | ||||
|           <option value="xdebug_get_stack_depth" /> | ||||
|           <option value="xdebug_get_tracefile_name" /> | ||||
|           <option value="xdebug_is_enabled" /> | ||||
|           <option value="xdebug_memory_usage" /> | ||||
|           <option value="xdebug_peak_memory_usage" /> | ||||
|           <option value="xdebug_print_function_stack" /> | ||||
|           <option value="xdebug_start_code_coverage" /> | ||||
|           <option value="xdebug_start_error_collection" /> | ||||
|           <option value="xdebug_start_function_monitor" /> | ||||
|           <option value="xdebug_start_trace" /> | ||||
|           <option value="xdebug_stop_code_coverage" /> | ||||
|           <option value="xdebug_stop_error_collection" /> | ||||
|           <option value="xdebug_stop_function_monitor" /> | ||||
|           <option value="xdebug_stop_trace" /> | ||||
|           <option value="xdebug_time_index" /> | ||||
|           <option value="xdebug_var_dump" /> | ||||
|         </list> | ||||
|       </option> | ||||
|       <option name="migratedIntoUserSpace" value="true" /> | ||||
|     </inspection_tool> | ||||
|     <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true"> | ||||
|       <option name="myValues"> | ||||
|         <value> | ||||
|           <list size="2"> | ||||
|             <item index="0" class="java.lang.String" itemvalue="name" /> | ||||
|             <item index="1" class="java.lang.String" itemvalue="placeholder" /> | ||||
|           </list> | ||||
|         </value> | ||||
|       </option> | ||||
|       <option name="myCustomValuesEnabled" value="true" /> | ||||
|     </inspection_tool> | ||||
|     <inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true"> | ||||
|       <option name="myValues"> | ||||
|         <value> | ||||
|           <list size="13"> | ||||
|             <item index="0" class="java.lang.String" itemvalue="nobr" /> | ||||
|             <item index="1" class="java.lang.String" itemvalue="noembed" /> | ||||
|             <item index="2" class="java.lang.String" itemvalue="comment" /> | ||||
|             <item index="3" class="java.lang.String" itemvalue="noscript" /> | ||||
|             <item index="4" class="java.lang.String" itemvalue="embed" /> | ||||
|             <item index="5" class="java.lang.String" itemvalue="script" /> | ||||
|             <item index="6" class="java.lang.String" itemvalue="x-slot" /> | ||||
|             <item index="7" class="java.lang.String" itemvalue="x-login-card" /> | ||||
|             <item index="8" class="java.lang.String" itemvalue="x-labels-select" /> | ||||
|             <item index="9" class="java.lang.String" itemvalue="x-currency-select" /> | ||||
|             <item index="10" class="java.lang.String" itemvalue="x-term-select" /> | ||||
|             <item index="11" class="java.lang.String" itemvalue="x-providers-select" /> | ||||
|             <item index="12" class="java.lang.String" itemvalue="x-locations-select" /> | ||||
|           </list> | ||||
|         </value> | ||||
|       </option> | ||||
|       <option name="myCustomValuesEnabled" value="true" /> | ||||
|     </inspection_tool> | ||||
|     <inspection_tool class="Json5StandardCompliance" enabled="false" level="ERROR" enabled_by_default="false" /> | ||||
|     <inspection_tool class="JsonDuplicatePropertyKeys" enabled="false" level="WARNING" enabled_by_default="false" /> | ||||
|     <inspection_tool class="JsonSchemaCompliance" enabled="false" level="WARNING" enabled_by_default="false" /> | ||||
|     <inspection_tool class="JsonSchemaDeprecation" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> | ||||
|     <inspection_tool class="JsonSchemaRefReference" enabled="false" level="WARNING" enabled_by_default="false" /> | ||||
|     <inspection_tool class="JsonStandardCompliance" enabled="false" level="ERROR" enabled_by_default="false" /> | ||||
|     <inspection_tool class="SecurityAdvisoriesInspection" enabled="true" level="WARNING" enabled_by_default="true"> | ||||
|       <option name="optionConfiguration"> | ||||
|         <list> | ||||
|           <option value="barryvdh/laravel-debugbar" /> | ||||
|           <option value="behat/behat" /> | ||||
|           <option value="brianium/paratest" /> | ||||
|           <option value="codeception/codeception" /> | ||||
|           <option value="codedungeon/phpunit-result-printer" /> | ||||
|           <option value="composer/composer" /> | ||||
|           <option value="doctrine/coding-standard" /> | ||||
|           <option value="filp/whoops" /> | ||||
|           <option value="friendsofphp/php-cs-fixer" /> | ||||
|           <option value="humbug/humbug" /> | ||||
|           <option value="infection/infection" /> | ||||
|           <option value="jakub-onderka/php-parallel-lint" /> | ||||
|           <option value="johnkary/phpunit-speedtrap" /> | ||||
|           <option value="kalessil/production-dependencies-guard" /> | ||||
|           <option value="mikey179/vfsStream" /> | ||||
|           <option value="mockery/mockery" /> | ||||
|           <option value="mybuilder/phpunit-accelerator" /> | ||||
|           <option value="orchestra/testbench" /> | ||||
|           <option value="pdepend/pdepend" /> | ||||
|           <option value="phan/phan" /> | ||||
|           <option value="phing/phing" /> | ||||
|           <option value="phpcompatibility/php-compatibility" /> | ||||
|           <option value="phpmd/phpmd" /> | ||||
|           <option value="phpro/grumphp" /> | ||||
|           <option value="phpspec/phpspec" /> | ||||
|           <option value="phpspec/prophecy" /> | ||||
|           <option value="phpstan/phpstan" /> | ||||
|           <option value="phpunit/phpunit" /> | ||||
|           <option value="povils/phpmnd" /> | ||||
|           <option value="roave/security-advisories" /> | ||||
|           <option value="satooshi/php-coveralls" /> | ||||
|           <option value="sebastian/phpcpd" /> | ||||
|           <option value="slevomat/coding-standard" /> | ||||
|           <option value="spatie/phpunit-watcher" /> | ||||
|           <option value="squizlabs/php_codesniffer" /> | ||||
|           <option value="sstalle/php7cc" /> | ||||
|           <option value="symfony/debug" /> | ||||
|           <option value="symfony/maker-bundle" /> | ||||
|           <option value="symfony/phpunit-bridge" /> | ||||
|           <option value="symfony/var-dumper" /> | ||||
|           <option value="vimeo/psalm" /> | ||||
|           <option value="wimg/php-compatibility" /> | ||||
|           <option value="wp-coding-standards/wpcs" /> | ||||
|           <option value="yiisoft/yii2-coding-standards" /> | ||||
|           <option value="yiisoft/yii2-debug" /> | ||||
|           <option value="yiisoft/yii2-gii" /> | ||||
|           <option value="zendframework/zend-coding-standard" /> | ||||
|           <option value="zendframework/zend-debug" /> | ||||
|           <option value="zendframework/zend-test" /> | ||||
|         </list> | ||||
|       </option> | ||||
|     </inspection_tool> | ||||
|   </profile> | ||||
| </component> | ||||
							
								
								
									
										13
									
								
								.idea/laravel-idea.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								.idea/laravel-idea.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="LaravelIdeaMainSettings"> | ||||
|     <option name="frameworkFound" value="true" /> | ||||
|     <option name="generationStringSettings"> | ||||
|       <map> | ||||
|         <entry key="createEloquentScope:namespace" value="Models\Scopes" /> | ||||
|         <entry key="createModel:namespace" value="Models" /> | ||||
|       </map> | ||||
|     </option> | ||||
|     <option name="userClassName" value="App\Models\User" /> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										6
									
								
								.idea/laravel-plugin.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								.idea/laravel-plugin.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="LaravelPluginSettings"> | ||||
|     <option name="pluginEnabled" value="true" /> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										14
									
								
								.idea/laravel-query-settings.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								.idea/laravel-query-settings.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="LaravelQuerySettings"> | ||||
|     <option name="filterDataSources" value="true" /> | ||||
|     <option name="filteredDataSources"> | ||||
|       <set> | ||||
|         <option value="efc7de96-2071-4420-9d95-422a64f97449<-/lq/->myidlers" /> | ||||
|         <option value="efc7de96-2071-4420-9d95-422a64f97449<-/lq/->laravel" /> | ||||
|         <option value="efc7de96-2071-4420-9d95-422a64f97449<-/lq/->idlers" /> | ||||
|         <option value="efc7de96-2071-4420-9d95-422a64f97449<-/lq/->first-project" /> | ||||
|       </set> | ||||
|     </option> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										9
									
								
								.idea/markdown.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.idea/markdown.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="MarkdownSettings"> | ||||
|     <enabledExtensions> | ||||
|       <entry key="MermaidLanguageExtension" value="false" /> | ||||
|       <entry key="PlantUMLLanguageExtension" value="false" /> | ||||
|     </enabledExtensions> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										8
									
								
								.idea/modules.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								.idea/modules.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,8 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="ProjectModuleManager"> | ||||
|     <modules> | ||||
|       <module fileurl="file://$PROJECT_DIR$/.idea/idlers.iml" filepath="$PROJECT_DIR$/.idea/idlers.iml" /> | ||||
|     </modules> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										126
									
								
								.idea/php.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										126
									
								
								.idea/php.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,126 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="PhpIncludePathManager"> | ||||
|     <include_path> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/ramsey/uuid" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/ramsey/collection" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/laravel/framework" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/laravel/serializable-closure" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/laravel/tinker" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/laravel/breeze" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/laravel/sail" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/fakerphp/faker" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/facade/ignition-contracts" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/fruitcake/laravel-cors" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpoption/phpoption" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/webmozart/assert" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/egulias/email-validator" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/league/flysystem" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phar-io/manifest" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/nikic/php-parser" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/league/mime-type-detection" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phar-io/version" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/league/commonmark" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/league/config" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/diff" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/type" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/code-unit" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/comparator" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/exporter" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/complexity" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/version" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/environment" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/global-state" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psy/psysh" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/voku/portable-ascii" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/mockery/mockery" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/nesbot/carbon" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/nette/utils" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpspec/prophecy" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/nette/schema" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/dflydev/dot-access-data" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/brick/math" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/monolog/monolog" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/asm89/stack-cors" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/theseer/tokenizer" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psr/log" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psr/http-message" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psr/http-client" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psr/container" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psr/http-factory" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/psr/simple-cache" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/filp/whoops" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/doctrine/instantiator" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/nunomaduro/collision" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/doctrine/lexer" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/doctrine/inflector" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/tijsverkoyen/css-to-inline-styles" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/finder" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/routing" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/css-selector" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/mime" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/error-handler" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpunit/phpunit" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/console" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpunit/php-timer" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/dragonmantank/cron-expression" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/http-foundation" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/var-dumper" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/http-kernel" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/service-contracts" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/translation" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/string" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/process" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/composer" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/spatie/laravel-ignition" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/spatie/ignition" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/spatie/flare-client-php" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/spatie/backtrace" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/symfony/mailer" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/laravel/ui" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/_laravel_idea" /> | ||||
|       <path value="$PROJECT_DIR$/vendor/yajra/laravel-datatables-oracle" /> | ||||
|     </include_path> | ||||
|   </component> | ||||
|   <component name="PhpProjectSharedConfiguration" php_language_level="7.4" /> | ||||
|   <component name="PhpUnit"> | ||||
|     <phpunit_settings> | ||||
|       <PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" /> | ||||
|     </phpunit_settings> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										11
									
								
								.idea/phpunit.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								.idea/phpunit.xml
									
										
									
										generated
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="PHPUnit"> | ||||
|     <option name="directories"> | ||||
|       <list> | ||||
|         <option value="$PROJECT_DIR$/tests/Unit" /> | ||||
|         <option value="$PROJECT_DIR$/tests/Feature" /> | ||||
|       </list> | ||||
|     </option> | ||||
|   </component> | ||||
| </project> | ||||
							
								
								
									
										33
									
								
								app/Console/Commands/CreateDatabaseCommand.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								app/Console/Commands/CreateDatabaseCommand.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,33 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Console\Commands; | ||||
| 
 | ||||
| use Illuminate\Console\Command; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| 
 | ||||
| class CreateDatabaseCommand extends Command | ||||
| { | ||||
|     protected $signature = 'make:database {name}'; | ||||
| 
 | ||||
|     protected $description = 'Creates my_idlers database'; | ||||
| 
 | ||||
|     public function __construct() | ||||
|     { | ||||
|         parent::__construct(); | ||||
|     } | ||||
| 
 | ||||
|     public function handle() | ||||
|     { | ||||
|         $schemaName = $this->argument('name') ?: config("database.connections.mysql.database"); | ||||
|         $charset = config("database.connections.mysql.charset",'utf8mb4'); | ||||
|         $collation = config("database.connections.mysql.collation",'utf8mb4_unicode_ci'); | ||||
| 
 | ||||
|         config(["database.connections.mysql.database" => null]); | ||||
| 
 | ||||
|         $query = "CREATE DATABASE IF NOT EXISTS $schemaName CHARACTER SET $charset COLLATE $collation;"; | ||||
| 
 | ||||
|         DB::statement($query); | ||||
| 
 | ||||
|         config(["database.connections.mysql.database" => $schemaName]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										41
									
								
								app/Console/Kernel.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								app/Console/Kernel.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,41 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Console; | ||||
| 
 | ||||
| use Illuminate\Console\Scheduling\Schedule; | ||||
| use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||||
| 
 | ||||
| class Kernel extends ConsoleKernel | ||||
| { | ||||
|     /** | ||||
|      * The Artisan commands provided by your application. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $commands = [ | ||||
|         //
 | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * Define the application's command schedule. | ||||
|      * | ||||
|      * @param  \Illuminate\Console\Scheduling\Schedule  $schedule | ||||
|      * @return void | ||||
|      */ | ||||
|     protected function schedule(Schedule $schedule) | ||||
|     { | ||||
|         // $schedule->command('inspire')->hourly();
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Register the commands for the application. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     protected function commands() | ||||
|     { | ||||
|         $this->load(__DIR__.'/Commands'); | ||||
| 
 | ||||
|         require base_path('routes/console.php'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										40
									
								
								app/Exceptions/Handler.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								app/Exceptions/Handler.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Exceptions; | ||||
| 
 | ||||
| use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||||
| use Throwable; | ||||
| 
 | ||||
| class Handler extends ExceptionHandler | ||||
| { | ||||
|     /** | ||||
|      * A list of the exception types that are not reported. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $dontReport = [ | ||||
|         //
 | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * A list of the inputs that are never flashed for validation exceptions. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $dontFlash = [ | ||||
|         'password', | ||||
|         'password_confirmation', | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * Register the exception handling callbacks for the application. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function register() | ||||
|     { | ||||
|         $this->reportable(function (Throwable $e) { | ||||
|             //
 | ||||
|         }); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								app/Http/Controllers/AccountController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								app/Http/Controllers/AccountController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Auth; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| 
 | ||||
| class AccountController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         return view('account.index'); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request) | ||||
|     { | ||||
|         $user = Auth::user(); | ||||
|         $user->name = $request->name; | ||||
|         $user->email = $request->email; | ||||
|         $user->save(); | ||||
| 
 | ||||
|         return redirect()->route('account.index') | ||||
|             ->with('success', 'Account Updated Successfully.'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										261
									
								
								app/Http/Controllers/ApiController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										261
									
								
								app/Http/Controllers/ApiController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,261 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Labels; | ||||
| use App\Models\NetworkSpeed; | ||||
| use App\Models\Pricing; | ||||
| use App\Models\Providers; | ||||
| use App\Models\Server; | ||||
| use App\Models\Shared; | ||||
| use DataTables; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| 
 | ||||
| class ApiController extends Controller | ||||
| { | ||||
|     protected function getAllServers() | ||||
|     { | ||||
|         $servers = DB::table('servers as s') | ||||
|             ->Join('pricings as p', 's.id', '=', 'p.service_id') | ||||
|             ->get(['s.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
| 
 | ||||
|         return response($servers, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getServer($id) | ||||
|     { | ||||
|         $server = DB::table('servers as s') | ||||
|             ->Join('pricings as p', 's.id', '=', 'p.service_id') | ||||
|             ->where('s.id', '=', $id) | ||||
|             ->get(['s.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date']); | ||||
| 
 | ||||
|         $yabs = DB::table('yabs') | ||||
|             ->where('yabs.server_id', '=', $id) | ||||
|             ->get(); | ||||
| 
 | ||||
|         $disk_speed = DB::table('disk_speed') | ||||
|             ->where('disk_speed.server_id', '=', $id) | ||||
|             ->get(); | ||||
| 
 | ||||
|         $network_speed = DB::table('network_speed') | ||||
|             ->where('network_speed.server_id', '=', $id) | ||||
|             ->get(); | ||||
| 
 | ||||
|         $labels = DB::table('labels_assigned as la') | ||||
|             ->Join('labels as l', 'la.label_id', '=', 'l.id') | ||||
|             ->where('la.service_id', '=', $id) | ||||
|             ->get(['l.*']); | ||||
| 
 | ||||
|         $server['yabs'] = $yabs; | ||||
|         $server['disk_speed'] = $disk_speed; | ||||
|         $server['network_speed'] = $network_speed; | ||||
|         $server['labels'] = $labels; | ||||
| 
 | ||||
|         return response($server, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllPricing() | ||||
|     { | ||||
|         $pricing = Pricing::all()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($pricing, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getPricing($id) | ||||
|     { | ||||
|         $pricing = Pricing::where('id', $id)->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($pricing, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllNetworkSpeeds() | ||||
|     { | ||||
|         $ns = NetworkSpeed::all()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($ns, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getNetworkSpeeds($id) | ||||
|     { | ||||
|         $ns = DB::table('network_speed as n') | ||||
|             ->where('n.server_id', '=', $id) | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($ns, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllLabels() | ||||
|     { | ||||
|         $labels = Labels::all()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($labels, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getLabel($id) | ||||
|     { | ||||
|         $label = DB::table('labels as l') | ||||
|             ->where('l.id', '=', $id) | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($label, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllShared() | ||||
|     { | ||||
|         $shared = DB::table('shared_hosting as sh') | ||||
|             ->Join('pricings as p', 'sh.id', '=', 'p.service_id') | ||||
|             ->get(['sh.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($shared, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getShared($id) | ||||
|     { | ||||
|         $shared = DB::table('shared_hosting as sh') | ||||
|             ->Join('pricings as p', 'sh.id', '=', 'p.service_id') | ||||
|             ->where('sh.id', '=', $id) | ||||
|             ->get(['sh.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($shared, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllReseller() | ||||
|     { | ||||
|         $reseller = DB::table('reseller_hosting as rh') | ||||
|             ->Join('pricings as p', 'rh.id', '=', 'p.service_id') | ||||
|             ->get(['rh.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($reseller, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getReseller($id) | ||||
|     { | ||||
|         $reseller = DB::table('reseller_hosting as rh') | ||||
|             ->Join('pricings as p', 'rh.id', '=', 'p.service_id') | ||||
|             ->where('rh.id', '=', $id) | ||||
|             ->get(['rh.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($reseller, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllDomains() | ||||
|     { | ||||
|         $domains = DB::table('domains as d') | ||||
|             ->Join('pricings as p', 'd.id', '=', 'p.service_id') | ||||
|             ->get(['d.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($domains, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getDomains($id) | ||||
|     { | ||||
|         $domain = DB::table('domains as d') | ||||
|             ->Join('pricings as p', 'd.id', '=', 'p.service_id') | ||||
|             ->where('d.id', '=', $id) | ||||
|             ->get(['d.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($domain, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllMisc() | ||||
|     { | ||||
|         $misc = DB::table('misc_services as m') | ||||
|             ->Join('pricings as p', 'm.id', '=', 'p.service_id') | ||||
|             ->get(['m.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($misc, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getMisc($id) | ||||
|     { | ||||
|         $misc = DB::table('misc_services as m') | ||||
|             ->Join('pricings as p', 'm.id', '=', 'p.service_id') | ||||
|             ->where('m.id', '=', $id) | ||||
|             ->get(['m.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($misc, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllDns() | ||||
|     { | ||||
|         $dns = DB::table('d_n_s') | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($dns, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getDns($id) | ||||
|     { | ||||
|         $dns = DB::table('d_n_s') | ||||
|             ->where('id', '=', $id) | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($dns, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllLocations() | ||||
|     { | ||||
|         $locations = DB::table('locations') | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($locations, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getLocation($id) | ||||
|     { | ||||
|         $location = DB::table('locations') | ||||
|             ->where('id', '=', $id) | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($location, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllProviders() | ||||
|     { | ||||
|         $providers = DB::table('providers') | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($providers, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getProvider($id) | ||||
|     { | ||||
|         $providers = DB::table('providers') | ||||
|             ->where('id', '=', $id) | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($providers, 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getAllSettings() | ||||
|     { | ||||
|         $settings = DB::table('settings') | ||||
|             ->get()->toJson(JSON_PRETTY_PRINT); | ||||
|         return response($settings, 200); | ||||
|     } | ||||
| 
 | ||||
|     public function getAllProvidersTable(Request $request) | ||||
|     { | ||||
|         if ($request->ajax()) { | ||||
|             $data = Providers::latest()->get(); | ||||
|             $dt = Datatables::of($data) | ||||
|                 ->addIndexColumn() | ||||
|                 ->addColumn('action', function ($row) { | ||||
|                     $actionBtn = '<form action="' . route('providers.destroy', $row['id']) . '" method="POST"><i class="fas fa-trash text-danger ms-3" @click="modalForm" id="btn-' . $row['name'] . '" title="' . $row['id'] . '"></i> </form>'; | ||||
|                     return $actionBtn; | ||||
|                 }) | ||||
|                 ->rawColumns(['action']) | ||||
|                 ->make(true); | ||||
|             return $dt; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     protected function checkHostIsUp(string $hostname) | ||||
|     {//Check if host/ip is "up"
 | ||||
|         ($fp = @fsockopen($hostname, 80, $errCode, $errStr, 1)) ? $result = true : $result = false; | ||||
|         if ($fp) { | ||||
|             @fclose($fp); | ||||
|         } | ||||
|         return response(array('is_online' => $result), 200); | ||||
|     } | ||||
| 
 | ||||
|     protected function getIpForDomain(string $domainname, string $type) | ||||
|     {//Gets IP from A record for a domain
 | ||||
|         switch ($type) { | ||||
|             case "A": | ||||
|                 $data = dns_get_record($domainname, DNS_A); | ||||
|                 if (isset($data['0']['ip'])) { | ||||
|                     return response(array('ip' => $data['0']['ip']), 200); | ||||
|                 } | ||||
|             case "AAAA": | ||||
|                 $data = dns_get_record($domainname, DNS_AAAA); | ||||
|                 if (isset($data['0']['ipv6'])) { | ||||
|                     return response(array('ip' => $data['0']['ipv6']), 200); | ||||
|                 } | ||||
|                 break; | ||||
|         } | ||||
|         return response(array('ip' => null), 200); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										54
									
								
								app/Http/Controllers/Auth/AuthenticatedSessionController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								app/Http/Controllers/Auth/AuthenticatedSessionController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,54 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Http\Requests\Auth\LoginRequest; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Auth; | ||||
| 
 | ||||
| class AuthenticatedSessionController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Display the login view. | ||||
|      * | ||||
|      * @return \Illuminate\View\View | ||||
|      */ | ||||
|     public function create() | ||||
|     { | ||||
|         return view('auth.login'); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Handle an incoming authentication request. | ||||
|      * | ||||
|      * @param  \App\Http\Requests\Auth\LoginRequest  $request | ||||
|      * @return \Illuminate\Http\RedirectResponse | ||||
|      */ | ||||
|     public function store(LoginRequest $request) | ||||
|     { | ||||
|         $request->authenticate(); | ||||
| 
 | ||||
|         $request->session()->regenerate(); | ||||
| 
 | ||||
|         return redirect()->intended(RouteServiceProvider::HOME); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Destroy an authenticated session. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return \Illuminate\Http\RedirectResponse | ||||
|      */ | ||||
|     public function destroy(Request $request) | ||||
|     { | ||||
|         Auth::guard('web')->logout(); | ||||
| 
 | ||||
|         $request->session()->invalidate(); | ||||
| 
 | ||||
|         $request->session()->regenerateToken(); | ||||
| 
 | ||||
|         return redirect('/'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										40
									
								
								app/Http/Controllers/Auth/ConfirmPasswordController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								app/Http/Controllers/Auth/ConfirmPasswordController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Foundation\Auth\ConfirmsPasswords; | ||||
| 
 | ||||
| class ConfirmPasswordController extends Controller | ||||
| { | ||||
|     /* | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | Confirm Password Controller | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | | ||||
|     | This controller is responsible for handling password confirmations and | ||||
|     | uses a simple trait to include the behavior. You're free to explore | ||||
|     | this trait and override any functions that require customization. | ||||
|     | | ||||
|     */ | ||||
| 
 | ||||
|     use ConfirmsPasswords; | ||||
| 
 | ||||
|     /** | ||||
|      * Where to redirect users when the intended url fails. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $redirectTo = RouteServiceProvider::HOME; | ||||
| 
 | ||||
|     /** | ||||
|      * Create a new controller instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         $this->middleware('auth'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										44
									
								
								app/Http/Controllers/Auth/ConfirmablePasswordController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								app/Http/Controllers/Auth/ConfirmablePasswordController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,44 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Auth; | ||||
| use Illuminate\Validation\ValidationException; | ||||
| 
 | ||||
| class ConfirmablePasswordController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Show the confirm password view. | ||||
|      * | ||||
|      * @return \Illuminate\View\View | ||||
|      */ | ||||
|     public function show() | ||||
|     { | ||||
|         return view('auth.confirm-password'); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Confirm the user's password. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return mixed | ||||
|      */ | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         if (! Auth::guard('web')->validate([ | ||||
|             'email' => $request->user()->email, | ||||
|             'password' => $request->password, | ||||
|         ])) { | ||||
|             throw ValidationException::withMessages([ | ||||
|                 'password' => __('auth.password'), | ||||
|             ]); | ||||
|         } | ||||
| 
 | ||||
|         $request->session()->put('auth.password_confirmed_at', time()); | ||||
| 
 | ||||
|         return redirect()->intended(RouteServiceProvider::HOME); | ||||
|     } | ||||
| } | ||||
|  | @ -0,0 +1,27 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| class EmailVerificationNotificationController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Send a new email verification notification. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return \Illuminate\Http\RedirectResponse | ||||
|      */ | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         if ($request->user()->hasVerifiedEmail()) { | ||||
|             return redirect()->intended(RouteServiceProvider::HOME); | ||||
|         } | ||||
| 
 | ||||
|         $request->user()->sendEmailVerificationNotification(); | ||||
| 
 | ||||
|         return back()->with('status', 'verification-link-sent'); | ||||
|     } | ||||
| } | ||||
|  | @ -0,0 +1,23 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| class EmailVerificationPromptController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Display the email verification prompt. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return mixed | ||||
|      */ | ||||
|     public function __invoke(Request $request) | ||||
|     { | ||||
|         return $request->user()->hasVerifiedEmail() | ||||
|                     ? redirect()->intended(RouteServiceProvider::HOME) | ||||
|                     : view('auth.verify-email'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										22
									
								
								app/Http/Controllers/Auth/ForgotPasswordController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								app/Http/Controllers/Auth/ForgotPasswordController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use Illuminate\Foundation\Auth\SendsPasswordResetEmails; | ||||
| 
 | ||||
| class ForgotPasswordController extends Controller | ||||
| { | ||||
|     /* | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | Password Reset Controller | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | | ||||
|     | This controller is responsible for handling password reset emails and | ||||
|     | includes a trait which assists in sending these notifications from | ||||
|     | your application to your users. Feel free to explore this trait. | ||||
|     | | ||||
|     */ | ||||
| 
 | ||||
|     use SendsPasswordResetEmails; | ||||
| } | ||||
							
								
								
									
										42
									
								
								app/Http/Controllers/Auth/LoginController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								app/Http/Controllers/Auth/LoginController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,42 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Foundation\Auth\AuthenticatesUsers; | ||||
| 
 | ||||
| class LoginController extends Controller | ||||
| { | ||||
|     /* | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | Login Controller | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | | ||||
|     | This controller handles authenticating users for the application and | ||||
|     | redirecting them to your home screen. The controller uses a trait | ||||
|     | to conveniently provide its functionality to your applications. | ||||
|     | | ||||
|     */ | ||||
| 
 | ||||
|     use AuthenticatesUsers; | ||||
| 
 | ||||
|     /** | ||||
|      * Where to redirect users after login. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $redirectTo = RouteServiceProvider::HOME; | ||||
| 
 | ||||
|     /** | ||||
|      * Create a new controller instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         $this->middleware('guest')->except('logout'); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										65
									
								
								app/Http/Controllers/Auth/NewPasswordController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								app/Http/Controllers/Auth/NewPasswordController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,65 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use Illuminate\Auth\Events\PasswordReset; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Hash; | ||||
| use Illuminate\Support\Facades\Password; | ||||
| use Illuminate\Support\Str; | ||||
| use Illuminate\Validation\Rules; | ||||
| 
 | ||||
| class NewPasswordController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Display the password reset view. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return \Illuminate\View\View | ||||
|      */ | ||||
|     public function create(Request $request) | ||||
|     { | ||||
|         return view('auth.reset-password', ['request' => $request]); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Handle an incoming new password request. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return \Illuminate\Http\RedirectResponse | ||||
|      * | ||||
|      * @throws \Illuminate\Validation\ValidationException | ||||
|      */ | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'token' => ['required'], | ||||
|             'email' => ['required', 'email'], | ||||
|             'password' => ['required', 'confirmed', Rules\Password::defaults()], | ||||
|         ]); | ||||
| 
 | ||||
|         // Here we will attempt to reset the user's password. If it is successful we
 | ||||
|         // will update the password on an actual user model and persist it to the
 | ||||
|         // database. Otherwise we will parse the error and return the response.
 | ||||
|         $status = Password::reset( | ||||
|             $request->only('email', 'password', 'password_confirmation', 'token'), | ||||
|             function ($user) use ($request) { | ||||
|                 $user->forceFill([ | ||||
|                     'password' => Hash::make($request->password), | ||||
|                     'remember_token' => Str::random(60), | ||||
|                 ])->save(); | ||||
| 
 | ||||
|                 event(new PasswordReset($user)); | ||||
|             } | ||||
|         ); | ||||
| 
 | ||||
|         // If the password was successfully reset, we will redirect the user back to
 | ||||
|         // the application's home authenticated view. If there is an error we can
 | ||||
|         // redirect them back to where they came from with their error message.
 | ||||
|         return $status == Password::PASSWORD_RESET | ||||
|                     ? redirect()->route('login')->with('status', __($status)) | ||||
|                     : back()->withInput($request->only('email')) | ||||
|                             ->withErrors(['email' => __($status)]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										47
									
								
								app/Http/Controllers/Auth/PasswordResetLinkController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								app/Http/Controllers/Auth/PasswordResetLinkController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,47 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Password; | ||||
| 
 | ||||
| class PasswordResetLinkController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Display the password reset link request view. | ||||
|      * | ||||
|      * @return \Illuminate\View\View | ||||
|      */ | ||||
|     public function create() | ||||
|     { | ||||
|         return view('auth.forgot-password'); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Handle an incoming password reset link request. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return \Illuminate\Http\RedirectResponse | ||||
|      * | ||||
|      * @throws \Illuminate\Validation\ValidationException | ||||
|      */ | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'email' => ['required', 'email'], | ||||
|         ]); | ||||
| 
 | ||||
|         // We will send the password reset link to this user. Once we have attempted
 | ||||
|         // to send the link, we will examine the response then see the message we
 | ||||
|         // need to show to the user. Finally, we'll send out a proper response.
 | ||||
|         $status = Password::sendResetLink( | ||||
|             $request->only('email') | ||||
|         ); | ||||
| 
 | ||||
|         return $status == Password::RESET_LINK_SENT | ||||
|                     ? back()->with('status', __($status)) | ||||
|                     : back()->withInput($request->only('email')) | ||||
|                             ->withErrors(['email' => __($status)]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										75
									
								
								app/Http/Controllers/Auth/RegisterController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								app/Http/Controllers/Auth/RegisterController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,75 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use App\Models\User; | ||||
| use Illuminate\Foundation\Auth\RegistersUsers; | ||||
| use Illuminate\Support\Facades\Hash; | ||||
| use Illuminate\Support\Facades\Validator; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class RegisterController extends Controller | ||||
| { | ||||
|     /* | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | Register Controller | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | | ||||
|     | This controller handles the registration of new users as well as their | ||||
|     | validation and creation. By default this controller uses a trait to | ||||
|     | provide this functionality without requiring any additional code. | ||||
|     | | ||||
|     */ | ||||
| 
 | ||||
|     use RegistersUsers; | ||||
| 
 | ||||
|     /** | ||||
|      * Where to redirect users after registration. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $redirectTo = RouteServiceProvider::HOME; | ||||
| 
 | ||||
|     /** | ||||
|      * Create a new controller instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         $this->middleware('guest'); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Get a validator for an incoming registration request. | ||||
|      * | ||||
|      * @param  array  $data | ||||
|      * @return \Illuminate\Contracts\Validation\Validator | ||||
|      */ | ||||
|     protected function validator(array $data) | ||||
|     { | ||||
|         return Validator::make($data, [ | ||||
|             'name' => ['required', 'string', 'max:255'], | ||||
|             'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | ||||
|             'password' => ['required', 'string', 'min:8', 'confirmed'], | ||||
|         ]); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Create a new user instance after a valid registration. | ||||
|      * | ||||
|      * @param  array  $data | ||||
|      * @return \App\Models\User | ||||
|      */ | ||||
|     protected function create(array $data) | ||||
|     { | ||||
|         return User::create([ | ||||
|             'name' => $data['name'], | ||||
|             'email' => $data['email'], | ||||
|             'password' => Hash::make($data['password']), | ||||
|             'api_token' => Str::random(60) | ||||
|         ]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										60
									
								
								app/Http/Controllers/Auth/RegisteredUserController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								app/Http/Controllers/Auth/RegisteredUserController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,60 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Models\User; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Auth\Events\Registered; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Auth; | ||||
| use Illuminate\Support\Facades\Hash; | ||||
| use Illuminate\Support\Str; | ||||
| use Illuminate\Validation\Rules; | ||||
| 
 | ||||
| class RegisteredUserController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Display the registration view. | ||||
|      * | ||||
|      * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View | ||||
|      */ | ||||
|     public function create() | ||||
|     { | ||||
|         $users = User::all(); | ||||
|         if ($users->count() >= 1) {//Only allow 1 user for this app
 | ||||
|             return redirect('/login'); | ||||
|         } | ||||
|         return view('auth.register'); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Handle an incoming registration request. | ||||
|      * | ||||
|      * @param \Illuminate\Http\Request $request | ||||
|      * @return \Illuminate\Http\RedirectResponse | ||||
|      * | ||||
|      * @throws \Illuminate\Validation\ValidationException | ||||
|      */ | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'name' => ['required', 'string', 'max:255'], | ||||
|             'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | ||||
|             'password' => ['required', 'confirmed', Rules\Password::defaults()], | ||||
|         ]); | ||||
| 
 | ||||
|         $user = User::create([ | ||||
|             'name' => $request->name, | ||||
|             'email' => $request->email, | ||||
|             'password' => Hash::make($request->password), | ||||
|             'api_token' => Str::random(60) | ||||
|         ]); | ||||
| 
 | ||||
|         event(new Registered($user)); | ||||
| 
 | ||||
|         Auth::login($user); | ||||
| 
 | ||||
|         return redirect('/'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										31
									
								
								app/Http/Controllers/Auth/ResetPasswordController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								app/Http/Controllers/Auth/ResetPasswordController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Foundation\Auth\ResetsPasswords; | ||||
| 
 | ||||
| class ResetPasswordController extends Controller | ||||
| { | ||||
|     /* | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | Password Reset Controller | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | | ||||
|     | This controller is responsible for handling password reset requests | ||||
|     | and uses a simple trait to include this behavior. You're free to | ||||
|     | explore this trait and override any methods you wish to tweak. | ||||
|     | | ||||
|     */ | ||||
| 
 | ||||
|     use ResetsPasswords; | ||||
| 
 | ||||
|     /** | ||||
|      * Where to redirect users after resetting their password. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $redirectTo = RouteServiceProvider::HOME; | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										42
									
								
								app/Http/Controllers/Auth/VerificationController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								app/Http/Controllers/Auth/VerificationController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,42 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Foundation\Auth\VerifiesEmails; | ||||
| 
 | ||||
| class VerificationController extends Controller | ||||
| { | ||||
|     /* | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | Email Verification Controller | ||||
|     |-------------------------------------------------------------------------- | ||||
|     | | ||||
|     | This controller is responsible for handling email verification for any | ||||
|     | user that recently registered with the application. Emails may also | ||||
|     | be re-sent if the user didn't receive the original email message. | ||||
|     | | ||||
|     */ | ||||
| 
 | ||||
|     use VerifiesEmails; | ||||
| 
 | ||||
|     /** | ||||
|      * Where to redirect users after verification. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $redirectTo = RouteServiceProvider::HOME; | ||||
| 
 | ||||
|     /** | ||||
|      * Create a new controller instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         $this->middleware('auth'); | ||||
|         $this->middleware('signed')->only('verify'); | ||||
|         $this->middleware('throttle:6,1')->only('verify', 'resend'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										30
									
								
								app/Http/Controllers/Auth/VerifyEmailController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								app/Http/Controllers/Auth/VerifyEmailController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,30 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers\Auth; | ||||
| 
 | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Illuminate\Auth\Events\Verified; | ||||
| use Illuminate\Foundation\Auth\EmailVerificationRequest; | ||||
| 
 | ||||
| class VerifyEmailController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Mark the authenticated user's email address as verified. | ||||
|      * | ||||
|      * @param  \Illuminate\Foundation\Auth\EmailVerificationRequest  $request | ||||
|      * @return \Illuminate\Http\RedirectResponse | ||||
|      */ | ||||
|     public function __invoke(EmailVerificationRequest $request) | ||||
|     { | ||||
|         if ($request->user()->hasVerifiedEmail()) { | ||||
|             return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); | ||||
|         } | ||||
| 
 | ||||
|         if ($request->user()->markEmailAsVerified()) { | ||||
|             event(new Verified($request->user())); | ||||
|         } | ||||
| 
 | ||||
|         return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								app/Http/Controllers/Controller.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/Http/Controllers/Controller.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||||
| use Illuminate\Foundation\Bus\DispatchesJobs; | ||||
| use Illuminate\Foundation\Validation\ValidatesRequests; | ||||
| use Illuminate\Routing\Controller as BaseController; | ||||
| 
 | ||||
| class Controller extends BaseController | ||||
| { | ||||
|     use AuthorizesRequests, DispatchesJobs, ValidatesRequests; | ||||
| } | ||||
							
								
								
									
										132
									
								
								app/Http/Controllers/DNSController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										132
									
								
								app/Http/Controllers/DNSController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,132 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\DNS; | ||||
| use App\Models\Labels; | ||||
| use App\Models\Reseller; | ||||
| use App\Models\Server; | ||||
| use App\Models\Domains; | ||||
| use App\Models\Shared; | ||||
| use Carbon\Carbon; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class DNSController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $dn = DB::table('d_n_s')->get(); | ||||
|         return view('dns.index', compact(['dn'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         $Servers = Server::all(); | ||||
|         $Domains = Domains::all(); | ||||
|         $Shareds = Shared::all(); | ||||
|         $Resellers = Reseller::all(); | ||||
|         return view('dns.create', compact(['Servers', 'Domains', 'Shareds', 'Resellers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'hostname' => 'required|min:2', | ||||
|             'address' => 'required|min:2', | ||||
|             'dns_type' => 'required' | ||||
|         ]); | ||||
| 
 | ||||
|         $dns_id = Str::random(8); | ||||
| 
 | ||||
|         DNS::create([ | ||||
|             'id' => $dns_id, | ||||
|             'hostname' => $request->hostname, | ||||
|             'dns_type' => $request->dns_type, | ||||
|             'address' => $request->address, | ||||
|             'server_id' => ($request->server_id !== 'null') ? $request->server_id : null, | ||||
|             'shared_id' => ($request->shared_id !== 'null') ? $request->shared_id : null, | ||||
|             'reseller_id' => ($request->reseller_id !== 'null') ? $request->reseller_id : null, | ||||
|             'domain_id' => ($request->domain_id !== 'null') ? $request->domain_id : null | ||||
|         ]); | ||||
| 
 | ||||
|         $labels_array = [$request->label1, $request->label2, $request->label3, $request->label4]; | ||||
| 
 | ||||
|         for ($i = 1; $i <= 4; $i++) { | ||||
|             if (!is_null($labels_array[($i - 1)])) { | ||||
|                 DB::insert('INSERT IGNORE INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $dns_id]); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return redirect()->route('dns.index') | ||||
|             ->with('success', 'DNS Created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function show(DNS $dn) | ||||
|     { | ||||
|         $dns = DNS::findOrFail($dn->id); | ||||
|         return view('dns.show', compact(['dn', 'dns'])); | ||||
|     } | ||||
| 
 | ||||
|     public function edit(DNS $dn) | ||||
|     { | ||||
|         $Servers = Server::all(); | ||||
|         $Domains = Domains::all(); | ||||
|         $Shareds = Shared::all(); | ||||
|         $Resellers = Reseller::all(); | ||||
|         $dn = DNS::findOrFail($dn->id); | ||||
|         $labels = DB::table('labels_assigned as l') | ||||
|             ->join('labels', 'l.label_id', '=', 'labels.id') | ||||
|             ->where('l.service_id', '=', $dn->id) | ||||
|             ->get(['labels.id', 'labels.label']); | ||||
| 
 | ||||
|         return view('dns.edit', compact(['dn', 'labels','Servers', 'Domains', 'Shareds', 'Resellers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request, DNS $dn) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'hostname' => 'required|min:2', | ||||
|             'address' => 'required|min:2', | ||||
|             'dns_type' => 'required' | ||||
|         ]); | ||||
| 
 | ||||
|         $dn->update([ | ||||
|             'hostname' => $request->hostname, | ||||
|             'dns_type' => $request->dns_type, | ||||
|             'address' => $request->address, | ||||
|             'server_id' => ($request->server_id !== 'null') ? $request->server_id : null, | ||||
|             'shared_id' => ($request->shared_id !== 'null') ? $request->shared_id : null, | ||||
|             'reseller_id' => ($request->reseller_id !== 'null') ? $request->reseller_id : null, | ||||
|             'domain_id' => ($request->domain_id !== 'null') ? $request->domain_id : null | ||||
|         ]); | ||||
| 
 | ||||
| 
 | ||||
|         $deleted = DB::table('labels_assigned')->where('service_id', '=', $dn->id)->delete(); | ||||
| 
 | ||||
|         $labels_array = [$request->label1, $request->label2, $request->label3, $request->label4]; | ||||
| 
 | ||||
|         for ($i = 1; $i <= 4; $i++) { | ||||
|             if (!is_null($labels_array[($i - 1)])) { | ||||
|                 DB::insert('INSERT IGNORE INTO labels_assigned ( label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $dn->id]); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return redirect()->route('dns.index') | ||||
|             ->with('success', 'DNS updated Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(DNS $dn) | ||||
|     { | ||||
|         $id = $dn->id; | ||||
|         $items = DNS::find($id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         Labels::deleteLabelsAssignedTo($id); | ||||
| 
 | ||||
|         return redirect()->route('dns.index') | ||||
|             ->with('success', 'DNS was deleted Successfully.'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										29
									
								
								app/Http/Controllers/DiskSpeedController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								app/Http/Controllers/DiskSpeedController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\DiskSpeed; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| class DiskSpeedController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(DiskSpeed $diskSpeed) | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										174
									
								
								app/Http/Controllers/DomainsController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										174
									
								
								app/Http/Controllers/DomainsController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,174 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Domains; | ||||
| use App\Models\Labels; | ||||
| use App\Models\Pricing; | ||||
| use App\Models\Providers; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class DomainsController extends Controller | ||||
| { | ||||
| 
 | ||||
|     public function index() | ||||
|     { | ||||
|         $domains = DB::table('domains as d') | ||||
|             ->join('providers as p', 'd.provider_id', '=', 'p.id') | ||||
|             ->join('pricings as pr', 'd.id', '=', 'pr.service_id') | ||||
|             ->get(['d.*', 'p.name as provider_name', 'pr.*']); | ||||
| 
 | ||||
|         return view('domains.index', compact(['domains'])); | ||||
|     } | ||||
| 
 | ||||
|     public function show(Domains $domain) | ||||
|     { | ||||
|         $service_extras = DB::table('domains as d') | ||||
|             ->join('providers as p', 'd.provider_id', '=', 'p.id') | ||||
|             ->join('pricings as pr', 'd.id', '=', 'pr.service_id') | ||||
|             ->where('d.id', '=', $domain->id) | ||||
|             ->get(['d.*', 'p.name as provider_name', 'pr.*']); | ||||
| 
 | ||||
|         return view('domains.show', compact(['domain', 'service_extras'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         $Providers = Providers::all(); | ||||
|         return view('domains.create', compact('Providers')); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'domain' => 'required|min:2', | ||||
|             'extension' => 'required|min:2', | ||||
|             'provider_id' => 'numeric', | ||||
|             'price' => 'numeric', | ||||
|             'next_due_date' => 'required|date' | ||||
|         ]); | ||||
| 
 | ||||
|         $domain_id = Str::random(8); | ||||
| 
 | ||||
|         Domains::create([ | ||||
|             'id' => $domain_id, | ||||
|             'domain' => $request->domain, | ||||
|             'extension' => $request->extension, | ||||
|             'ns1' => $request->ns1, | ||||
|             'ns2' => $request->ns2, | ||||
|             'ns3' => $request->ns3, | ||||
|             'provider_id' => $request->provider_id, | ||||
|             'owned_since' => $request->owned_since | ||||
|         ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         Pricing::create([ | ||||
|             'service_id' => $domain_id, | ||||
|             'service_type' => 4, | ||||
|             'currency' => $request->currency, | ||||
|             'price' => $request->price, | ||||
|             'term' => $request->payment_term, | ||||
|             'as_usd' => $as_usd, | ||||
|             'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|             'next_due_date' => $request->next_due_date, | ||||
|         ]); | ||||
| 
 | ||||
|         $labels_array = [$request->label1, $request->label2, $request->label3, $request->label4]; | ||||
| 
 | ||||
|         for ($i = 1; $i <= 4; $i++) { | ||||
|             if (!is_null($labels_array[($i - 1)])) { | ||||
|                 DB::insert('INSERT INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $domain_id]); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return redirect()->route('domains.index') | ||||
|             ->with('success', 'Domain Created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function edit(Domains $domain) | ||||
|     { | ||||
|         $domain_info = DB::table('domains as d') | ||||
|             ->join('pricings as pr', 'd.id', '=', 'pr.service_id') | ||||
|             ->where('d.id', '=', $domain->id) | ||||
|             ->get(['d.*', 'pr.*']); | ||||
| 
 | ||||
|         $labels = DB::table('labels_assigned as l') | ||||
|             ->join('labels', 'l.label_id', '=', 'labels.id') | ||||
|             ->where('l.service_id', '=', $domain->id) | ||||
|             ->get(['labels.id', 'labels.label']); | ||||
| 
 | ||||
|         return view('domains.edit', compact(['domain', 'domain_info', 'labels'])); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request, Domains $domain) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'domain' => 'required|min:2', | ||||
|             'extension' => 'required|min:2', | ||||
|             'provider_id' => 'numeric', | ||||
|             'price' => 'numeric' | ||||
|         ]); | ||||
| 
 | ||||
|         $domain->update([ | ||||
|             'domain' => $request->domain, | ||||
|             'extension' => $request->extension, | ||||
|             'ns1' => $request->ns1, | ||||
|             'ns2' => $request->ns2, | ||||
|             'ns3' => $request->ns3, | ||||
|             'provider_id' => $request->provider_id, | ||||
|             'owned_since' => $request->owned_since, | ||||
|             'active' => (isset($request->is_active)) ? 1 : 0 | ||||
|         ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         DB::table('pricings') | ||||
|             ->where('service_id', $domain->id) | ||||
|             ->update([ | ||||
|                 'service_type' => 4, | ||||
|                 'currency' => $request->currency, | ||||
|                 'price' => $request->price, | ||||
|                 'term' => $request->payment_term, | ||||
|                 'as_usd' => $as_usd, | ||||
|                 'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|                 'next_due_date' => $request->next_due_date, | ||||
|                 'active' => (isset($request->is_active)) ? 1 : 0 | ||||
|             ]); | ||||
| 
 | ||||
|         $deleted = DB::table('labels_assigned')->where('service_id', '=', $domain->id)->delete(); | ||||
| 
 | ||||
|         $labels_array = [$request->label1, $request->label2, $request->label3, $request->label4]; | ||||
| 
 | ||||
|         for ($i = 1; $i <= 4; $i++) { | ||||
|             if (!is_null($labels_array[($i - 1)])) { | ||||
|                 DB::insert('INSERT IGNORE INTO labels_assigned ( label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $domain->id]); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return redirect()->route('domains.index') | ||||
|             ->with('success', 'Domain Updated Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Domains $domain) | ||||
|     { | ||||
|         $items = Domains::find($domain->id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         $p = new Pricing(); | ||||
|         $p->deletePricing($domain->id); | ||||
| 
 | ||||
|         Labels::deleteLabelsAssignedTo($domain->id); | ||||
| 
 | ||||
|         return redirect()->route('domains.index') | ||||
|             ->with('success', 'Domain was deleted Successfully.'); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										161
									
								
								app/Http/Controllers/HomeController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										161
									
								
								app/Http/Controllers/HomeController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,161 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Pricing; | ||||
| use Carbon\Carbon; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use App\Process; | ||||
| use Illuminate\Support\Facades\Session; | ||||
| 
 | ||||
| //Custom code example
 | ||||
| 
 | ||||
| class HomeController extends Controller | ||||
| { | ||||
|     /** | ||||
|      * Create a new controller instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         $this->middleware('auth'); | ||||
|     } | ||||
| 
 | ||||
|     public function index() | ||||
|     { | ||||
|         $p = new Process(); | ||||
|         $p->startTimer(); | ||||
| 
 | ||||
|         $services_count = DB::table('pricings') | ||||
|             ->select('service_type', DB::raw('COUNT(*) as amount')) | ||||
|             ->groupBy('service_type') | ||||
|             ->where('active', '=', 1) | ||||
|             ->get(); | ||||
| 
 | ||||
| 
 | ||||
|         $due_soon = DB::table('pricings as p') | ||||
|             ->leftJoin('servers as s', 'p.service_id', '=', 's.id') | ||||
|             ->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id') | ||||
|             ->leftJoin('reseller_hosting as r', 'p.service_id', '=', 'r.id') | ||||
|             ->leftJoin('domains as d', 'p.service_id', '=', 'd.id') | ||||
|             ->leftJoin('misc_services as ms', 'p.service_id', '=', 'ms.id') | ||||
|             ->where('p.active', '=', 1) | ||||
|             ->orderBy('next_due_date', 'ASC') | ||||
|             ->limit(6) | ||||
|             ->get(['p.*', 's.hostname', 'd.domain', 'd.extension', 'r.main_domain as reseller', 'sh.main_domain', 'ms.name']); | ||||
| 
 | ||||
| 
 | ||||
|         //Check for past due date and refresh the due date if so:
 | ||||
|         $pricing = new Pricing(); | ||||
|         $count = 0; | ||||
|         foreach ($due_soon as $service) { | ||||
|             if (Carbon::createFromFormat('Y-m-d', $service->next_due_date)->isPast()) { | ||||
|                 $months = $pricing->termAsMonths($service->term);//Get months for term to update the next due date to
 | ||||
|                 $new_due_date = Carbon::createFromFormat('Y-m-d', $service->next_due_date)->addMonths($months)->format('Y-m-d'); | ||||
|                 DB::table('pricings')//Update the DB
 | ||||
|                 ->where('service_id', $service->service_id) | ||||
|                     ->update(['next_due_date' => $new_due_date]); | ||||
|                 $due_soon[$count]->next_due_date = $new_due_date;//Update array being sent to view
 | ||||
|             } else { | ||||
|                 break;//Break because if this date isnt past than the ones after it in the loop wont be either
 | ||||
|             } | ||||
|             $count++; | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         $recently_added = DB::table('pricings as p') | ||||
|             ->leftJoin('servers as s', 'p.service_id', '=', 's.id') | ||||
|             ->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id') | ||||
|             ->leftJoin('reseller_hosting as r', 'p.service_id', '=', 'r.id') | ||||
|             ->leftJoin('domains as d', 'p.service_id', '=', 'd.id') | ||||
|             ->leftJoin('misc_services as ms', 'p.service_id', '=', 'ms.id') | ||||
|             ->where('p.active', '=', 1) | ||||
|             ->orderBy('created_at', 'DESC') | ||||
|             ->limit(6) | ||||
|             ->get(['p.*', 's.hostname', 'd.domain', 'd.extension', 'r.main_domain as reseller', 'sh.main_domain', 'ms.name']); | ||||
| 
 | ||||
|         $settings = DB::table('settings') | ||||
|             ->where('id', '=', 1) | ||||
|             ->get(); | ||||
| 
 | ||||
|         Session::put('timer_version_footer', $settings[0]->show_versions_footer); | ||||
|         Session::put('show_servers_public', $settings[0]->show_servers_public); | ||||
|         Session::save(); | ||||
| 
 | ||||
|         $pricing = json_decode(DB::table('pricings')->get(), true); | ||||
| 
 | ||||
|         $total_cost_weekly = $total_cost_pm = $inactive_count = 0; | ||||
|         foreach ($pricing as $price) { | ||||
|             if ($price['active'] === 1) { | ||||
|                 if ($price['term'] === 1) {//1 month
 | ||||
|                     $total_cost_weekly += ($price['as_usd'] / 4); | ||||
|                     $total_cost_pm += $price['as_usd']; | ||||
|                 } elseif ($price['term'] === 2) {//3 months
 | ||||
|                     $total_cost_weekly += ($price['as_usd'] / 12); | ||||
|                     $total_cost_pm += ($price['as_usd'] / 3); | ||||
|                 } elseif ($price['term'] === 3) {// 6 month
 | ||||
|                     $total_cost_weekly += ($price['as_usd'] / 24); | ||||
|                     $total_cost_pm += ($price['as_usd'] / 6); | ||||
|                 } elseif ($price['term'] === 4) {// 1 year
 | ||||
|                     $total_cost_weekly += ($price['as_usd'] / 48); | ||||
|                     $total_cost_pm += ($price['as_usd'] / 12); | ||||
|                 } elseif ($price['term'] === 5) {//2 years
 | ||||
|                     $total_cost_weekly += ($price['as_usd'] / 96); | ||||
|                     $total_cost_pm += ($price['as_usd'] / 24); | ||||
|                 } elseif ($price['term'] === 6) {//3 years
 | ||||
|                     $total_cost_weekly += ($price['as_usd'] / 144); | ||||
|                     $total_cost_pm += ($price['as_usd'] / 36); | ||||
|                 } | ||||
|             } else { | ||||
|                 $inactive_count++; | ||||
|             } | ||||
|         } | ||||
|         $total_cost_yearly = ($total_cost_pm * 12); | ||||
| 
 | ||||
|         $services_count = json_decode($services_count, true); | ||||
| 
 | ||||
|         $servers_count = $domains_count = $shared_count = $reseller_count = $other_count = $total_services = 0; | ||||
| 
 | ||||
|         foreach ($services_count as $sc) { | ||||
|             $total_services += $sc['amount']; | ||||
|             if ($sc['service_type'] === 1) { | ||||
|                 $servers_count = $sc['amount']; | ||||
|             } else if ($sc['service_type'] === 2) { | ||||
|                 $shared_count = $sc['amount']; | ||||
|             } else if ($sc['service_type'] === 3) { | ||||
|                 $reseller_count = $sc['amount']; | ||||
|             } else if ($sc['service_type'] === 4) { | ||||
|                 $domains_count = $sc['amount']; | ||||
|             } else if ($sc['service_type'] === 5) { | ||||
|                 $other_count = $sc['amount']; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         $p->stopTimer(); | ||||
| 
 | ||||
|         $information = array( | ||||
|             'servers' => $servers_count, | ||||
|             'domains' => $domains_count, | ||||
|             'shared' => $shared_count, | ||||
|             'reseller' => $reseller_count, | ||||
|             'misc' => $other_count, | ||||
|             'labels' => DB::table('labels')->count(), | ||||
|             'dns' => DB::table('d_n_s')->count(), | ||||
|             'total_services' => $total_services, | ||||
|             'total_inactive' => $inactive_count, | ||||
|             'total_cost_weekly' => number_format($total_cost_weekly, 2), | ||||
|             'total_cost_monthly' => number_format($total_cost_pm, 2), | ||||
|             'total_cost_yearly' => number_format($total_cost_yearly, 2), | ||||
|             'total_cost_2_yearly' => number_format(($total_cost_yearly * 2), 2), | ||||
|             'due_soon' => $due_soon, | ||||
|             'newest' => $recently_added, | ||||
|             'execution_time' => number_format($p->getTimeTaken(), 2) | ||||
|         ); | ||||
| 
 | ||||
|         //dd($information);
 | ||||
| 
 | ||||
|         return view('home', compact('information')); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										62
									
								
								app/Http/Controllers/LabelsController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								app/Http/Controllers/LabelsController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,62 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Labels; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class LabelsController extends Controller | ||||
| { | ||||
| 
 | ||||
|     public function index() | ||||
|     { | ||||
|         $labels = Labels::all(); | ||||
|         return view('labels.index', compact(['labels'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         return view('labels.create'); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'label' => 'required|min:2' | ||||
|         ]); | ||||
| 
 | ||||
|         Labels::create([ | ||||
|             'id' => Str::random(8), | ||||
|             'label' => $request->label | ||||
|         ]); | ||||
| 
 | ||||
|         return redirect()->route('labels.index') | ||||
|             ->with('success', 'Label Created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function show(Labels $label) | ||||
|     { | ||||
|         return view('labels.show', compact(['label'])); | ||||
|     } | ||||
| 
 | ||||
|     public function edit(Labels $label) | ||||
|     { | ||||
|         abort(404); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Labels $label) | ||||
|     { | ||||
|         $label_id = $label->id; | ||||
| 
 | ||||
|         $items = Labels::find($label_id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         Labels::deleteLabelAssignedAs($label_id); | ||||
| 
 | ||||
|         return redirect()->route('labels.index') | ||||
|             ->with('success', 'Label was deleted Successfully.'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										45
									
								
								app/Http/Controllers/LocationsController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								app/Http/Controllers/LocationsController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,45 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Locations; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| 
 | ||||
| class LocationsController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $locations = Locations::all(); | ||||
|         return view('locations.index', compact(['locations'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         return view('locations.create'); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'location_name' => 'required|min:2' | ||||
|         ]); | ||||
| 
 | ||||
|         Locations::create([ | ||||
|             'name' => $request->location_name | ||||
|         ]); | ||||
| 
 | ||||
|         return redirect()->route('locations.index') | ||||
|             ->with('success', 'Location Created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Locations $location) | ||||
|     { | ||||
|         $items = Locations::find($location->id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         return redirect()->route('locations.index') | ||||
|             ->with('success', 'Location was deleted Successfully.'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										130
									
								
								app/Http/Controllers/MiscController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										130
									
								
								app/Http/Controllers/MiscController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,130 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Misc; | ||||
| use App\Models\Pricing; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class MiscController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $misc = DB::table('misc_services as d') | ||||
|             ->join('pricings as pr', 'd.id', '=', 'pr.service_id') | ||||
|             ->get(['d.*', 'pr.*']); | ||||
| 
 | ||||
|         return view('misc.index', compact(['misc'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         return view('misc.create'); | ||||
|     } | ||||
| 
 | ||||
|     public function show(Misc $misc) | ||||
|     { | ||||
|         $service_extras = DB::table('misc_services as m') | ||||
|             ->join('pricings as p', 'm.id', '=', 'p.service_id') | ||||
|             ->where('m.id', '=', $misc->id) | ||||
|             ->get(['m.*', 'p.*']); | ||||
| 
 | ||||
|         return view('misc.show', compact(['misc', 'service_extras'])); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'name' => 'required|min:3', | ||||
|             'price' => 'required|numeric', | ||||
|             'owned_since' => 'date', | ||||
|             'next_due_date' => 'required|date' | ||||
|         ]); | ||||
| 
 | ||||
|         $ms_id = Str::random(8); | ||||
| 
 | ||||
|         Misc::create([ | ||||
|             'id' => $ms_id, | ||||
|             'name' => $request->name, | ||||
|             'owned_since' => $request->owned_since | ||||
|         ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         Pricing::create([ | ||||
|             'service_id' => $ms_id, | ||||
|             'service_type' => 5, | ||||
|             'currency' => $request->currency, | ||||
|             'price' => $request->price, | ||||
|             'term' => $request->payment_term, | ||||
|             'as_usd' => $as_usd, | ||||
|             'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|             'next_due_date' => $request->next_due_date, | ||||
|         ]); | ||||
| 
 | ||||
|         return redirect()->route('misc.index') | ||||
|             ->with('success', 'Misc service created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function edit(Misc $misc) | ||||
|     { | ||||
|         $misc = DB::table('misc_services as s') | ||||
|             ->join('pricings as p', 's.id', '=', 'p.service_id') | ||||
|             ->where('s.id', '=', $misc->id) | ||||
|             ->get(['s.*', 'p.*']); | ||||
| 
 | ||||
|         return view('misc.edit', compact('misc')); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request, Misc $misc) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'name' => 'required', | ||||
|             'owned_since' => 'date', | ||||
|         ]); | ||||
| 
 | ||||
|         DB::table('misc_services') | ||||
|             ->where('id', $misc->id) | ||||
|             ->update([ | ||||
|                 'name' => $request->name, | ||||
|                 'owned_since' => $request->owned_since, | ||||
|                 'active' => (isset($request->is_active)) ? 1 : 0 | ||||
|             ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         DB::table('pricings') | ||||
|             ->where('service_id', $misc->id) | ||||
|             ->update([ | ||||
|                 'currency' => $request->currency, | ||||
|                 'price' => $request->price, | ||||
|                 'term' => $request->payment_term, | ||||
|                 'as_usd' => $as_usd, | ||||
|                 'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|                 'next_due_date' => $request->next_due_date, | ||||
|                 'active' => (isset($request->is_active)) ? 1 : 0 | ||||
|             ]); | ||||
| 
 | ||||
|         return redirect()->route('misc.index') | ||||
|             ->with('success', 'Misc service updated Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Misc $misc) | ||||
|     { | ||||
|         $items = Misc::find($misc->id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         $p = new Pricing(); | ||||
|         $p->deletePricing($misc->id); | ||||
| 
 | ||||
|         return redirect()->route('misc.index') | ||||
|             ->with('success', 'Misc service was deleted Successfully.'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										24
									
								
								app/Http/Controllers/NetworkSpeedController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								app/Http/Controllers/NetworkSpeedController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,24 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\NetworkSpeed; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| class NetworkSpeedController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     public function show(NetworkSpeed $networkSpeed) | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(NetworkSpeed $networkSpeed) | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										19
									
								
								app/Http/Controllers/PricingController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								app/Http/Controllers/PricingController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Pricing; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| class PricingController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Pricing $pricing) | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										62
									
								
								app/Http/Controllers/ProvidersController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								app/Http/Controllers/ProvidersController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,62 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Providers; | ||||
| use DataTables; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| class ProvidersController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $providers = Providers::all(); | ||||
|         return view('providers.index', compact(['providers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         return view('providers.create'); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'provider_name' => 'required|min:2' | ||||
|         ]); | ||||
| 
 | ||||
|         Providers::create([ | ||||
|             'name' => $request->provider_name | ||||
|         ]); | ||||
| 
 | ||||
|         return redirect()->route('providers.index') | ||||
|             ->with('success', 'Provider Created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Providers $provider) | ||||
|     { | ||||
|         $items = Providers::find($provider->id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         return redirect()->route('providers.index') | ||||
|             ->with('success', 'Provider was deleted Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function getProviders(Request $request) | ||||
|     { | ||||
|         if ($request->ajax()) { | ||||
|             $data = Providers::latest()->get(); | ||||
|             $dt = Datatables::of($data) | ||||
|                 ->addIndexColumn() | ||||
|                 ->addColumn('action', function($row){ | ||||
|                     $actionBtn = '<a href="javascript:void(0)" class="edit btn btn-success btn-sm">Edit</a> <a href="javascript:void(0)" class="delete btn btn-danger btn-sm">Delete</a>'; | ||||
|                     return $actionBtn; | ||||
|                 }) | ||||
|                 ->rawColumns(['action']) | ||||
|                 ->make(true); | ||||
|             dd($dt); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										217
									
								
								app/Http/Controllers/ResellerController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										217
									
								
								app/Http/Controllers/ResellerController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,217 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Labels; | ||||
| use App\Models\Locations; | ||||
| use App\Models\Pricing; | ||||
| use App\Models\Providers; | ||||
| use App\Models\Reseller; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class ResellerController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $resellers = DB::table('reseller_hosting as s') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->get(['s.*', 'p.name as provider_name', 'pr.*', 'l.name as location']); | ||||
| 
 | ||||
|         return view('reseller.index', compact(['resellers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         $Providers = Providers::all(); | ||||
|         $Locations = Locations::all(); | ||||
|         return view('reseller.create', compact(['Providers', 'Locations'])); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
| 
 | ||||
|         $request->validate([ | ||||
|             'domain' => 'required|min:4', | ||||
|             'reseller_type' => 'required', | ||||
|             'dedicated_ip' => 'present', | ||||
|             'accounts' => 'numeric', | ||||
|             'has_dedicated_ip' => 'numeric', | ||||
|             'server_type' => 'numeric', | ||||
|             'ram' => 'numeric', | ||||
|             'disk' => 'numeric', | ||||
|             'os_id' => 'numeric', | ||||
|             'provider_id' => 'numeric', | ||||
|             'location_id' => 'numeric', | ||||
|             'price' => 'numeric', | ||||
|             'payment_term' => 'numeric', | ||||
|             'was_promo' => 'numeric', | ||||
|             'owned_since' => 'date', | ||||
|             'domains' => 'numeric', | ||||
|             'sub_domains' => 'numeric', | ||||
|             'bandwidth' => 'numeric', | ||||
|             'email' => 'numeric', | ||||
|             'ftp' => 'numeric', | ||||
|             'db' => 'numeric', | ||||
|             'next_due_date' => 'required|date' | ||||
|         ]); | ||||
| 
 | ||||
|         $reseller_id = Str::random(8); | ||||
| 
 | ||||
|         Reseller::create([ | ||||
|             'id' => $reseller_id, | ||||
|             'main_domain' => $request->domain, | ||||
|             'accounts' => $request->accounts, | ||||
|             'reseller_type' => $request->reseller_type, | ||||
|             'has_dedicated_ip' => $request->has_dedicated_ip, | ||||
|             'ip' => $request->dedicated_ip, | ||||
|             'provider_id' => $request->provider_id, | ||||
|             'location_id' => $request->location_id, | ||||
|             'disk' => $request->disk, | ||||
|             'disk_type' => 'GB', | ||||
|             'disk_as_gb' => $request->disk, | ||||
|             'owned_since' => $request->owned_since, | ||||
|             'bandwidth' => $request->bandwidth, | ||||
|             'was_promo' => $request->was_promo, | ||||
|             'domains_limit' => $request->domains, | ||||
|             'subdomains_limit' => $request->sub_domains, | ||||
|             'email_limit' => $request->email, | ||||
|             'ftp_limit' => $request->ftp, | ||||
|             'db_limit' => $request->db | ||||
|         ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         Pricing::create([ | ||||
|             'service_id' => $reseller_id, | ||||
|             'service_type' => 3, | ||||
|             'currency' => $request->currency, | ||||
|             'price' => $request->price, | ||||
|             'term' => $request->payment_term, | ||||
|             'as_usd' => $as_usd, | ||||
|             'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|             'next_due_date' => $request->next_due_date, | ||||
|         ]); | ||||
| 
 | ||||
|         return redirect()->route('reseller.index') | ||||
|             ->with('success', 'Reseller hosting created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public function show(Reseller $reseller) | ||||
|     { | ||||
|         $reseller_extras = DB::table('reseller_hosting as s') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->where('s.id', '=', $reseller->id) | ||||
|             ->get(['s.*', 'p.name as provider_name', 'l.name as location', 'pr.*']); | ||||
| 
 | ||||
|         $labels = DB::table('labels_assigned as l') | ||||
|             ->join('labels', 'l.label_id', '=', 'labels.id') | ||||
|             ->where('l.service_id', '=', $reseller->id) | ||||
|             ->get(['labels.label']); | ||||
| 
 | ||||
|         return view('reseller.show', compact(['reseller', 'reseller_extras', 'labels'])); | ||||
|     } | ||||
| 
 | ||||
|     public function edit(Reseller $reseller) | ||||
|     { | ||||
|         $locations = DB::table('locations')->get(['*']); | ||||
|         $providers = json_decode(DB::table('providers')->get(['*']), true); | ||||
| 
 | ||||
|         $reseller = DB::table('reseller_hosting as s') | ||||
|             ->join('pricings as p', 's.id', '=', 'p.service_id') | ||||
|             ->where('s.id', '=', $reseller->id) | ||||
|             ->get(['s.*', 'p.*']); | ||||
| 
 | ||||
|         return view('reseller.edit', compact(['reseller', 'locations', 'providers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request, Reseller $reseller) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'id' => 'required|size:8', | ||||
|             'domain' => 'required|min:4', | ||||
|             'reseller_type' => 'required', | ||||
|             'dedicated_ip' => 'present', | ||||
|             'has_dedicated_ip' => 'numeric', | ||||
|             'server_type' => 'numeric', | ||||
|             'disk' => 'numeric', | ||||
|             'os_id' => 'numeric', | ||||
|             'provider_id' => 'numeric', | ||||
|             'location_id' => 'numeric', | ||||
|             'price' => 'numeric', | ||||
|             'payment_term' => 'numeric', | ||||
|             'was_promo' => 'numeric', | ||||
|             'owned_since' => 'date', | ||||
|             'domains' => 'numeric', | ||||
|             'sub_domains' => 'numeric', | ||||
|             'bandwidth' => 'numeric', | ||||
|             'email' => 'numeric', | ||||
|             'ftp' => 'numeric', | ||||
|             'db' => 'numeric' | ||||
|         ]); | ||||
| 
 | ||||
|         DB::table('reseller_hosting') | ||||
|             ->where('id', $request->id) | ||||
|             ->update([ | ||||
|                 'main_domain' => $request->domain, | ||||
|                 'reseller_type' => $request->reseller_type, | ||||
|                 'has_dedicated_ip' => $request->has_dedicated_ip, | ||||
|                 'ip' => $request->dedicated_ip, | ||||
|                 'provider_id' => $request->provider_id, | ||||
|                 'location_id' => $request->location_id, | ||||
|                 'disk' => $request->disk, | ||||
|                 'disk_type' => 'GB', | ||||
|                 'disk_as_gb' => $request->disk, | ||||
|                 'owned_since' => $request->owned_since, | ||||
|                 'bandwidth' => $request->bandwidth, | ||||
|                 'was_promo' => $request->was_promo, | ||||
|                 'domains_limit' => $request->domains, | ||||
|                 'subdomains_limit' => $request->sub_domains, | ||||
|                 'email_limit' => $request->email, | ||||
|                 'ftp_limit' => $request->ftp, | ||||
|                 'db_limit' => $request->db | ||||
|             ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         DB::table('pricings') | ||||
|             ->where('service_id', $request->id) | ||||
|             ->update([ | ||||
|                 'currency' => $request->currency, | ||||
|                 'price' => $request->price, | ||||
|                 'term' => $request->payment_term, | ||||
|                 'as_usd' => $as_usd, | ||||
|                 'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|                 'next_due_date' => $request->next_due_date, | ||||
|             ]); | ||||
| 
 | ||||
|         return redirect()->route('reseller.index') | ||||
|             ->with('success', 'Reseller hosting updated Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Reseller $reseller) | ||||
|     { | ||||
|         $id = $reseller->id; | ||||
|         $items = Reseller::find($id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         $p = new Pricing(); | ||||
|         $p->deletePricing($reseller->id); | ||||
| 
 | ||||
|         Labels::deleteLabelsAssignedTo($id); | ||||
| 
 | ||||
|         return redirect()->route('reseller.index') | ||||
|             ->with('success', 'Reseller hosting was deleted Successfully.'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										306
									
								
								app/Http/Controllers/ServerController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										306
									
								
								app/Http/Controllers/ServerController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,306 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Labels; | ||||
| use App\Models\OS; | ||||
| use App\Models\Pricing; | ||||
| use App\Models\Server; | ||||
| use App\Models\Providers; | ||||
| use App\Models\Locations; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Config; | ||||
| use Illuminate\Support\Facades\Session; | ||||
| use Illuminate\Support\Str; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Carbon\Carbon; | ||||
| 
 | ||||
| class ServerController extends Controller | ||||
| { | ||||
| 
 | ||||
|     public function index() | ||||
|     { | ||||
|         $servers = DB::table('servers as s') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->join('os as o', 's.os_id', '=', 'o.id') | ||||
|             ->get(['s.*', 'pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'p.name as provider_name', 'l.name as location', 'o.name as os_name']); | ||||
|         return view('servers.index', compact(['servers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function showServersPublic() | ||||
|     { | ||||
|         $settings = DB::table('settings') | ||||
|             ->where('id', '=', 1) | ||||
|             ->get(); | ||||
| 
 | ||||
|         Session::put('timer_version_footer', $settings[0]->show_versions_footer); | ||||
|         Session::put('show_servers_public', $settings[0]->show_servers_public); | ||||
|         Session::save(); | ||||
|        // dd(Session::all());
 | ||||
| 
 | ||||
|         if (Session::has('show_servers_public') && Session::get('show_servers_public') === 1) { | ||||
|             $servers = DB::table('servers as s') | ||||
|                 ->Join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|                 ->Join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|                 ->Join('locations as l', 's.location_id', '=', 'l.id') | ||||
|                 ->Join('os as o', 's.os_id', '=', 'o.id') | ||||
|                 ->LeftJoin('yabs as y', 's.id', '=', 'y.server_id') | ||||
|                 ->LeftJoin('disk_speed as ds', 'y.id', '=', 'ds.id') | ||||
|                 ->get(['s.*', 'pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'pr.service_id', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'y.*', 'y.id as yabs_id', 'ds.*']); | ||||
| 
 | ||||
|             return view('servers.public-index', compact('servers')); | ||||
|         } | ||||
|         return response()->view('errors.404', array("status" => 404, "title" => "Page not found", "message" => ""), 404); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         $Providers = Providers::all(); | ||||
|         $Locations = Locations::all(); | ||||
|         $Os = OS::all(); | ||||
|         return view('servers.create', compact(['Providers', 'Locations', 'Os'])); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
| 
 | ||||
|         $request->validate([ | ||||
|             'hostname' => 'required|min:5', | ||||
|             'ipv4' => 'nullable|ipv4', | ||||
|             'ipv6' => 'nullable|ipv6', | ||||
|             'service_type' => 'numeric', | ||||
|             'server_type' => 'numeric', | ||||
|             'ram' => 'numeric', | ||||
|             'disk' => 'numeric', | ||||
|             'os_id' => 'numeric', | ||||
|             'provider_id' => 'numeric', | ||||
|             'location_id' => 'numeric', | ||||
|             'price' => 'numeric', | ||||
|             'cpu' => 'numeric', | ||||
|             'was_promo' => 'numeric', | ||||
|             'next_due_date' => 'required|date' | ||||
|         ]); | ||||
| 
 | ||||
|         $server_id = Str::random(8); | ||||
| 
 | ||||
|         Server::create([ | ||||
|             'id' => $server_id, | ||||
|             'hostname' => $request->hostname, | ||||
|             'ipv4' => $request->ipv4, | ||||
|             'ipv6' => $request->ipv6, | ||||
|             'server_type' => $request->server_type, | ||||
|             'os_id' => $request->os_id, | ||||
|             'ssh' => $request->ssh_port, | ||||
|             'provider_id' => $request->provider_id, | ||||
|             'location_id' => $request->location_id, | ||||
|             'ram' => $request->ram, | ||||
|             'ram_type' => $request->ram_type, | ||||
|             'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram / 1000), | ||||
|             'disk' => $request->disk, | ||||
|             'disk_type' => $request->disk_type, | ||||
|             'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1000), | ||||
|             'owned_since' => $request->owned_since, | ||||
|             'ns1' => $request->ns1, | ||||
|             'ns2' => $request->ns2, | ||||
|             'bandwidth' => $request->bandwidth, | ||||
|             'cpu' => $request->cpu, | ||||
|             'was_promo' => $request->was_promo | ||||
|         ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         Pricing::create([ | ||||
|             'service_id' => $server_id, | ||||
|             'service_type' => 1, | ||||
|             'currency' => $request->currency, | ||||
|             'price' => $request->price, | ||||
|             'term' => $request->payment_term, | ||||
|             'as_usd' => $as_usd, | ||||
|             'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|             'next_due_date' => $request->next_due_date, | ||||
|         ]); | ||||
| 
 | ||||
|         $labels_array = [$request->label1, $request->label2, $request->label3, $request->label4]; | ||||
| 
 | ||||
|         for ($i = 1; $i <= 4; $i++) { | ||||
|             if (!is_null($labels_array[($i - 1)])) { | ||||
|                 DB::insert('INSERT INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $server_id]); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return redirect()->route('servers.index') | ||||
|             ->with('success', 'Server Created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function show(Server $server) | ||||
|     { | ||||
|         $server_extras = DB::table('servers as s') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->join('os as o', 's.os_id', '=', 'o.id') | ||||
|             ->where('s.id', '=', $server->id) | ||||
|             ->get(['s.*', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'pr.*']); | ||||
| 
 | ||||
|         $labels = DB::table('labels_assigned as l') | ||||
|             ->join('labels', 'l.label_id', '=', 'labels.id') | ||||
|             ->where('l.service_id', '=', $server->id) | ||||
|             ->get(['labels.label']); | ||||
| 
 | ||||
|         return view('servers.show', compact(['server', 'server_extras', 'labels'])); | ||||
|     } | ||||
| 
 | ||||
|     public function edit(Server $server) | ||||
|     { | ||||
|         $locations = DB::table('locations')->get(['*']); | ||||
|         $providers = DB::table('providers')->get(['*']); | ||||
|         $labels = DB::table('labels_assigned as l') | ||||
|             ->join('labels', 'l.label_id', '=', 'labels.id') | ||||
|             ->where('l.service_id', '=', $server->id) | ||||
|             ->get(['labels.id', 'labels.label']); | ||||
| 
 | ||||
|         $os = DB::table('os')->get(['*']); | ||||
|         $server = DB::table('servers as s') | ||||
|             ->join('pricings as p', 's.id', '=', 'p.service_id') | ||||
|             ->where('s.id', '=', $server->id) | ||||
|             ->get(['s.*', 'p.*']); | ||||
| 
 | ||||
|         return view('servers.edit', compact(['server', 'locations', 'providers', 'os', 'labels'])); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request, Server $server) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'hostname' => 'required|min:5', | ||||
|             'ram' => 'numeric', | ||||
|             'disk' => 'numeric', | ||||
|             'os_id' => 'numeric', | ||||
|             'provider_id' => 'numeric', | ||||
|             'location_id' => 'numeric', | ||||
|             'price' => 'numeric', | ||||
|             'cpu' => 'numeric', | ||||
|             'was_promo' => 'numeric' | ||||
|         ]); | ||||
| 
 | ||||
| 
 | ||||
|         DB::table('servers') | ||||
|             ->where('id', $request->server_id) | ||||
|             ->update([ | ||||
|                 'hostname' => $request->hostname, | ||||
|                 'ipv4' => $request->ipv4, | ||||
|                 'ipv6' => $request->ipv6, | ||||
|                 'server_type' => $request->server_type, | ||||
|                 'os_id' => $request->os_id, | ||||
|                 'ssh' => $request->ssh, | ||||
|                 'provider_id' => $request->provider_id, | ||||
|                 'location_id' => $request->location_id, | ||||
|                 'ram' => $request->ram, | ||||
|                 'ram_type' => $request->ram_type, | ||||
|                 'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram / 1000), | ||||
|                 'disk' => $request->disk, | ||||
|                 'disk_type' => $request->disk_type, | ||||
|                 'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1000), | ||||
|                 'owned_since' => $request->owned_since, | ||||
|                 'ns1' => $request->ns1, | ||||
|                 'ns2' => $request->ns2, | ||||
|                 'bandwidth' => $request->bandwidth, | ||||
|                 'cpu' => $request->cpu, | ||||
|                 'was_promo' => $request->was_promo, | ||||
|                 'active' => (isset($request->is_active)) ? 1 : 0 | ||||
|             ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         DB::table('pricings') | ||||
|             ->where('service_id', $request->server_id) | ||||
|             ->update([ | ||||
|                 'service_type' => 1, | ||||
|                 'currency' => $request->currency, | ||||
|                 'price' => $request->price, | ||||
|                 'term' => $request->payment_term, | ||||
|                 'as_usd' => $as_usd, | ||||
|                 'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|                 'next_due_date' => $request->next_due_date, | ||||
|                 'active' => (isset($request->is_active)) ? 1 : 0 | ||||
|             ]); | ||||
| 
 | ||||
|         $deleted = DB::table('labels_assigned')->where('service_id', '=', $server->id)->delete(); | ||||
| 
 | ||||
|         $labels_array = [$request->label1, $request->label2, $request->label3, $request->label4]; | ||||
| 
 | ||||
|         for ($i = 1; $i <= 4; $i++) { | ||||
|             if (!is_null($labels_array[($i - 1)])) { | ||||
|                 DB::insert('INSERT IGNORE INTO labels_assigned ( label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $request->server_id]); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return redirect()->route('servers.index') | ||||
|             ->with('success', 'Server Updated Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Server $server) | ||||
|     { | ||||
|         $items = Server::find($server->id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         $p = new Pricing(); | ||||
|         $p->deletePricing($server->id); | ||||
| 
 | ||||
|         Labels::deleteLabelsAssignedTo($server->id); | ||||
| 
 | ||||
|         return redirect()->route('servers.index') | ||||
|             ->with('success', 'Server was deleted Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function chooseCompare() | ||||
|     { | ||||
|         $all_servers = Server::where('has_yabs', 1)->get(); | ||||
|         return view('servers.choose-compare', compact('all_servers')); | ||||
|     } | ||||
| 
 | ||||
|     public function compareServers($server1, $server2) | ||||
|     { | ||||
|         $server1_data = DB::table('servers as s') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->Join('yabs as y', 's.id', '=', 'y.server_id') | ||||
|             ->Join('disk_speed as ds', 'y.id', '=', 'ds.id') | ||||
|             ->where('s.id', '=', $server1) | ||||
|             ->get(['s.*', 'p.name as provider_name', 'l.name as location', 'pr.*', 'y.*', 'y.id as yabs_id', 'ds.*']); | ||||
| 
 | ||||
|         if (count($server1_data) === 0) { | ||||
|             return response()->view('errors.404', array("status" => 404, "title" => "Page not found", "message" => "No server with YABs data was found for id '$server1'"), 404); | ||||
|         } | ||||
| 
 | ||||
|         $server1_network = DB::table('network_speed') | ||||
|             ->where('id', '=', $server1_data[0]->yabs_id) | ||||
|             ->get(); | ||||
| 
 | ||||
|         $server2_data = DB::table('servers as s') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->Join('yabs as y', 's.id', '=', 'y.server_id') | ||||
|             ->Join('disk_speed as ds', 'y.id', '=', 'ds.id') | ||||
|             ->where('s.id', '=', $server2) | ||||
|             ->get(['s.*', 'p.name as provider_name', 'l.name as location', 'pr.*', 'y.*', 'y.id as yabs_id', 'ds.*']); | ||||
| 
 | ||||
|         if (count($server2_data) === 0) { | ||||
|             return response()->view('errors.404', array("status" => 404, "title" => "Page not found", "message" => "No server with YABs data was found for id '$server2'"), 404); | ||||
|         } | ||||
| 
 | ||||
|         $server2_network = DB::table('network_speed') | ||||
|             ->where('id', '=', $server2_data[0]->yabs_id) | ||||
|             ->get(); | ||||
| 
 | ||||
|         return view('servers.compare', compact('server1_data', 'server2_data', 'server1_network', 'server2_network')); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										56
									
								
								app/Http/Controllers/SettingsController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								app/Http/Controllers/SettingsController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,56 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Settings; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Facades\Session; | ||||
| 
 | ||||
| class SettingsController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $setting = DB::table('settings') | ||||
|             ->where('id', '=', 1) | ||||
|             ->get(); | ||||
| 
 | ||||
|         return view('settings.index', compact(['setting'])); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request, Settings $settings) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'show_versions_footer' => 'required|boolean', | ||||
|             'show_server_value_ip' => 'required|boolean', | ||||
|             'show_server_value_hostname' => 'required|boolean', | ||||
|             'show_server_value_provider' => 'required|boolean', | ||||
|             'show_server_value_location' => 'required|boolean', | ||||
|             'show_server_value_price' => 'required|boolean', | ||||
|             'show_server_value_yabs' => 'required|boolean' | ||||
|         ]); | ||||
| 
 | ||||
|         DB::table('settings') | ||||
|             ->where('id', 1) | ||||
|             ->update([ | ||||
|                 'show_versions_footer' => $request->show_versions_footer, | ||||
|                 'show_servers_public' => $request->show_servers_public, | ||||
|                 'show_server_value_ip' => $request->show_server_value_ip, | ||||
|                 'show_server_value_hostname' => $request->show_server_value_hostname, | ||||
|                 'show_server_value_provider' => $request->show_server_value_provider, | ||||
|                 'show_server_value_location' => $request->show_server_value_location, | ||||
|                 'show_server_value_price' => $request->show_server_value_price, | ||||
|                 'show_server_value_yabs' => $request->show_server_value_yabs | ||||
|             ]); | ||||
| 
 | ||||
|         Session::put('timer_version_footer', $request->show_versions_footer); | ||||
|         Session::put('show_servers_public', $request->show_servers_public); | ||||
|         Session::put('show_server_value_ip', $request->show_server_value_ip); | ||||
|         Session::put('show_server_value_hostname', $request->show_server_value_hostname); | ||||
|         Session::save(); | ||||
| 
 | ||||
|         return redirect()->route('settings.index') | ||||
|             ->with('success', 'Settings Updated Successfully.'); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										216
									
								
								app/Http/Controllers/SharedController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										216
									
								
								app/Http/Controllers/SharedController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,216 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Labels; | ||||
| use App\Models\Locations; | ||||
| use App\Models\Pricing; | ||||
| use App\Models\Providers; | ||||
| use App\Models\Shared; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class SharedController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $shared = DB::table('shared_hosting as s') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->get(['s.*', 'p.name as provider_name', 'pr.*', 'l.name as location']); | ||||
| 
 | ||||
|         return view('shared.index', compact(['shared'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         $Providers = Providers::all(); | ||||
|         $Locations = Locations::all(); | ||||
|         return view('shared.create', compact(['Providers', 'Locations'])); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
| 
 | ||||
|         $request->validate([ | ||||
|             'domain' => 'required|min:4', | ||||
|             'shared_type' => 'required', | ||||
|             'dedicated_ip' => 'present', | ||||
|             'has_dedicated_ip' => 'numeric', | ||||
|             'server_type' => 'numeric', | ||||
|             'ram' => 'numeric', | ||||
|             'disk' => 'numeric', | ||||
|             'os_id' => 'numeric', | ||||
|             'provider_id' => 'numeric', | ||||
|             'location_id' => 'numeric', | ||||
|             'price' => 'numeric', | ||||
|             'payment_term' => 'numeric', | ||||
|             'was_promo' => 'numeric', | ||||
|             'owned_since' => 'date', | ||||
|             'domains' => 'numeric', | ||||
|             'sub_domains' => 'numeric', | ||||
|             'bandwidth' => 'numeric', | ||||
|             'email' => 'numeric', | ||||
|             'ftp' => 'numeric', | ||||
|             'db' => 'numeric', | ||||
|             'next_due_date' => 'required|date' | ||||
|         ]); | ||||
| 
 | ||||
|         $shared_id = Str::random(8); | ||||
| 
 | ||||
|         Shared::create([ | ||||
|             'id' => $shared_id, | ||||
|             'main_domain' => $request->domain, | ||||
|             'shared_type' => $request->shared_type, | ||||
|             'has_dedicated_ip' => $request->has_dedicated_ip, | ||||
|             'ip' => $request->dedicated_ip, | ||||
|             'provider_id' => $request->provider_id, | ||||
|             'location_id' => $request->location_id, | ||||
|             'disk' => $request->disk, | ||||
|             'disk_type' => 'GB', | ||||
|             'disk_as_gb' => $request->disk, | ||||
|             'owned_since' => $request->owned_since, | ||||
|             'bandwidth' => $request->bandwidth, | ||||
|             'was_promo' => $request->was_promo, | ||||
|             'domains_limit' => $request->domains, | ||||
|             'subdomains_limit' => $request->sub_domains, | ||||
|             'email_limit' => $request->email, | ||||
|             'ftp_limit' => $request->ftp, | ||||
|             'db__limit' => $request->db | ||||
|         ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         Pricing::create([ | ||||
|             'service_id' => $shared_id, | ||||
|             'service_type' => 2, | ||||
|             'currency' => $request->currency, | ||||
|             'price' => $request->price, | ||||
|             'term' => $request->payment_term, | ||||
|             'as_usd' => $as_usd, | ||||
|             'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|             'next_due_date' => $request->next_due_date, | ||||
|         ]); | ||||
| 
 | ||||
|         return redirect()->route('shared.index') | ||||
|             ->with('success', 'Shared hosting created Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function show(Shared $shared) | ||||
|     { | ||||
|         $shared_extras = DB::table('shared_hosting as s') | ||||
|             ->join('pricings as pr', 's.id', '=', 'pr.service_id') | ||||
|             ->join('providers as p', 's.provider_id', '=', 'p.id') | ||||
|             ->join('locations as l', 's.location_id', '=', 'l.id') | ||||
|             ->where('s.id', '=', $shared->id) | ||||
|             ->get(['s.*', 'p.name as provider_name', 'l.name as location', 'pr.*']); | ||||
| 
 | ||||
|         $labels = DB::table('labels_assigned as l') | ||||
|             ->join('labels', 'l.label_id', '=', 'labels.id') | ||||
|             ->where('l.service_id', '=', $shared->id) | ||||
|             ->get(['labels.label']); | ||||
| 
 | ||||
|         return view('shared.show', compact(['shared', 'shared_extras', 'labels'])); | ||||
|     } | ||||
| 
 | ||||
|     public function edit(Shared $shared) | ||||
|     { | ||||
|         $locations = DB::table('locations')->get(['*']); | ||||
|         $providers = json_decode(DB::table('providers')->get(['*']), true); | ||||
| 
 | ||||
|         $shared = DB::table('shared_hosting as s') | ||||
|             ->join('pricings as p', 's.id', '=', 'p.service_id') | ||||
|             ->where('s.id', '=', $shared->id) | ||||
|             ->get(['s.*', 'p.*']); | ||||
| 
 | ||||
| 
 | ||||
|         return view('shared.edit', compact(['shared', 'locations', 'providers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function update(Request $request, Shared $shared) | ||||
|     { | ||||
|         $request->validate([ | ||||
|             'id' => 'required|size:8', | ||||
|             'domain' => 'required|min:4', | ||||
|             'shared_type' => 'required', | ||||
|             'dedicated_ip' => 'present', | ||||
|             'has_dedicated_ip' => 'numeric', | ||||
|             'server_type' => 'numeric', | ||||
|             'disk' => 'numeric', | ||||
|             'os_id' => 'numeric', | ||||
|             'provider_id' => 'numeric', | ||||
|             'location_id' => 'numeric', | ||||
|             'price' => 'numeric', | ||||
|             'payment_term' => 'numeric', | ||||
|             'was_promo' => 'numeric', | ||||
|             'owned_since' => 'date', | ||||
|             'domains' => 'numeric', | ||||
|             'sub_domains' => 'numeric', | ||||
|             'bandwidth' => 'numeric', | ||||
|             'email' => 'numeric', | ||||
|             'ftp' => 'numeric', | ||||
|             'db' => 'numeric' | ||||
|         ]); | ||||
| 
 | ||||
|         DB::table('shared_hosting') | ||||
|             ->where('id', $request->id) | ||||
|             ->update([ | ||||
|                 'main_domain' => $request->domain, | ||||
|                 'shared_type' => $request->shared_type, | ||||
|                 'has_dedicated_ip' => $request->has_dedicated_ip, | ||||
|                 'ip' => $request->dedicated_ip, | ||||
|                 'provider_id' => $request->provider_id, | ||||
|                 'location_id' => $request->location_id, | ||||
|                 'disk' => $request->disk, | ||||
|                 'disk_type' => 'GB', | ||||
|                 'disk_as_gb' => $request->disk, | ||||
|                 'owned_since' => $request->owned_since, | ||||
|                 'bandwidth' => $request->bandwidth, | ||||
|                 'was_promo' => $request->was_promo, | ||||
|                 'domains_limit' => $request->domains, | ||||
|                 'subdomains_limit' => $request->sub_domains, | ||||
|                 'email_limit' => $request->email, | ||||
|                 'ftp_limit' => $request->ftp, | ||||
|                 'db_limit' => $request->db | ||||
|             ]); | ||||
| 
 | ||||
|         $pricing = new Pricing(); | ||||
| 
 | ||||
|         $as_usd = $pricing->convertToUSD($request->price, $request->currency); | ||||
| 
 | ||||
|         DB::table('pricings') | ||||
|             ->where('service_id', $request->id) | ||||
|             ->update([ | ||||
|                 'currency' => $request->currency, | ||||
|                 'price' => $request->price, | ||||
|                 'term' => $request->payment_term, | ||||
|                 'as_usd' => $as_usd, | ||||
|                 'usd_per_month' => $pricing->costAsPerMonth($as_usd, $request->payment_term), | ||||
|                 'next_due_date' => $request->next_due_date, | ||||
|             ]); | ||||
| 
 | ||||
|         return redirect()->route('shared.index') | ||||
|             ->with('success', 'Shared hosting updated Successfully.'); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Shared $shared) | ||||
|     { | ||||
|         $id = $shared->id; | ||||
|         $items = Shared::find($id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         $p = new Pricing(); | ||||
|         $p->deletePricing($shared->id); | ||||
| 
 | ||||
|         Labels::deleteLabelsAssignedTo($shared->id); | ||||
| 
 | ||||
|         return redirect()->route('shared.index') | ||||
|             ->with('success', 'Shared hosting was deleted Successfully.'); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										140
									
								
								app/Http/Controllers/YabsController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										140
									
								
								app/Http/Controllers/YabsController.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,140 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use App\Models\Server; | ||||
| use App\Models\Yabs; | ||||
| use App\Process; | ||||
| use App\Models\DiskSpeed; | ||||
| use App\Models\NetworkSpeed; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Str; | ||||
| 
 | ||||
| class YabsController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|         $yabs = DB::table('yabs as y') | ||||
|             ->join('servers as s', 'y.server_id', '=', 's.id') | ||||
|             ->Join('disk_speed as ds', 'y.id', '=', 'ds.id') | ||||
|             ->get(['y.*', 's.hostname', 'ds.*']); | ||||
| 
 | ||||
|         return view('yabs.index', compact(['yabs'])); | ||||
|     } | ||||
| 
 | ||||
|     public function create() | ||||
|     { | ||||
|         $Servers = Server::all(); | ||||
|         return view('yabs.create', compact(['Servers'])); | ||||
|     } | ||||
| 
 | ||||
|     public function store(Request $request) | ||||
|     { | ||||
|         $process = new Process(); | ||||
| 
 | ||||
|         $yabs = $process->yabsOutputAsJson($request->server_id, $request->yabs); | ||||
| 
 | ||||
|         if (isset($yabs['error_id'])) { | ||||
|             return redirect()->route('yabs.index') | ||||
|                 ->with('error', 'Problem inserting YABs. Error id ' . $yabs['error_id']); | ||||
|         } | ||||
|         //No errors, do insert
 | ||||
| 
 | ||||
|         $yabs_id = Str::random(8); | ||||
| 
 | ||||
|         Yabs::create([ | ||||
|             'id' => $yabs_id, | ||||
|             'server_id' => $request->server_id, | ||||
|             'has_ipv6' => $yabs['has_ipv6'], | ||||
|             'aes' => $yabs['aes'], | ||||
|             'vm' => $yabs['vm'], | ||||
|             'output_date' => $yabs['output_date'], | ||||
|             'cpu_cores' => $yabs['cpu_cores'], | ||||
|             'cpu_freq' => $yabs['cpu_freq'], | ||||
|             'cpu' => $yabs['cpu'], | ||||
|             'ram' => $yabs['ram'], | ||||
|             'ram_type' => $yabs['ram_type'], | ||||
|             'ram_mb' => $yabs['ram_mb'], | ||||
|             'disk' => $yabs['disk'], | ||||
|             'disk_type' => $yabs['disk_type'], | ||||
|             'disk_gb' => $yabs['disk_gb'], | ||||
|             'gb5_single' => $yabs['GB5_single'], | ||||
|             'gb5_multi' => $yabs['GB5_mult'], | ||||
|             'gb5_id' => $yabs['GB5_id'] | ||||
|         ]); | ||||
| 
 | ||||
|         DiskSpeed::create([ | ||||
|             'id' => $yabs_id, | ||||
|             'server_id' => $request->server_id, | ||||
|             'd_4k' => $yabs['disk_speed']['4k_total'], | ||||
|             'd_4k_type' => $yabs['disk_speed']['4k_total_type'], | ||||
|             'd_4k_as_mbps' => $yabs['disk_speed']['4k_total_mbps'], | ||||
|             'd_64k' => $yabs['disk_speed']['64k_total'], | ||||
|             'd_64k_type' => $yabs['disk_speed']['64k_total_type'], | ||||
|             'd_64k_as_mbps' => $yabs['disk_speed']['64k_total_mbps'], | ||||
|             'd_512k' => $yabs['disk_speed']['512k_total'], | ||||
|             'd_512k_type' => $yabs['disk_speed']['512k_total_type'], | ||||
|             'd_512k_as_mbps' => $yabs['disk_speed']['512k_total_mbps'], | ||||
|             'd_1m' => $yabs['disk_speed']['1m_total'], | ||||
|             'd_1m_type' => $yabs['disk_speed']['1m_total_type'], | ||||
|             'd_1m_as_mbps' => $yabs['disk_speed']['1m_total_mbps'] | ||||
|         ]); | ||||
| 
 | ||||
|         foreach ($yabs['network_speed'] as $y) { | ||||
|             NetworkSpeed::create([ | ||||
|                 'id' => $yabs_id, | ||||
|                 'server_id' => $request->server_id, | ||||
|                 'location' => $y['location'], | ||||
|                 'send' => $y['send'], | ||||
|                 'send_type' => $y['send_type'], | ||||
|                 'send_as_mbps' => $y['send_type_mbps'], | ||||
|                 'receive' => $y['receive'], | ||||
|                 'receive_type' => $y['receive_type'], | ||||
|                 'receive_as_mbps' => $y['receive_type_mbps'] | ||||
|             ]); | ||||
|         } | ||||
| 
 | ||||
|         $update_server = DB::table('servers') | ||||
|             ->where('id', $request->server_id) | ||||
|             ->update([ | ||||
|                 'ram' => $yabs['ram'], | ||||
|                 'ram_type' => $yabs['ram_type'], | ||||
|                 'ram_as_mb' => ($yabs['ram_type'] === 'GB') ? ($yabs['ram'] * 1000) : $yabs['ram'], | ||||
|                 'disk' => $yabs['disk'], | ||||
|                 'disk_type' => $yabs['disk_type'], | ||||
|                 'disk_as_gb' => ($yabs['disk_type'] === 'TB') ? ($yabs['disk'] * 1000) : $yabs['disk'], | ||||
|                 'cpu' => $yabs['cpu_cores'], | ||||
|                 'has_yabs' => 1 | ||||
|             ]); | ||||
| 
 | ||||
|         return redirect()->route('yabs.index') | ||||
|             ->with('success', 'Success inserting YABs'); | ||||
|     } | ||||
| 
 | ||||
|     public function show(Yabs $yab) | ||||
|     { | ||||
|         $yab = DB::table('yabs as y') | ||||
|             ->join('servers as s', 'y.server_id', '=', 's.id') | ||||
|             ->join('disk_speed as ds', 'y.id', '=', 'ds.id') | ||||
|             ->where('y.id', '=', $yab->id) | ||||
|             ->get(['y.*', 's.hostname', 'ds.*']); | ||||
| 
 | ||||
|         $network = DB::table('network_speed') | ||||
|             ->where('id', '=', $yab[0]->id) | ||||
|             ->get(); | ||||
| 
 | ||||
|         return view('yabs.show', compact(['yab', 'network'])); | ||||
|     } | ||||
| 
 | ||||
|     public function destroy(Yabs $yab) | ||||
|     { | ||||
|         $id = $yab->id; | ||||
|         $items = Yabs::find($id); | ||||
| 
 | ||||
|         $items->delete(); | ||||
| 
 | ||||
|         return redirect()->route('yabs.index') | ||||
|             ->with('success', 'YABs was deleted Successfully.'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										71
									
								
								app/Http/Kernel.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								app/Http/Kernel.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,71 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http; | ||||
| 
 | ||||
| use App\Console\Commands\CreateDatabaseCommand; | ||||
| use Illuminate\Foundation\Http\Kernel as HttpKernel; | ||||
| 
 | ||||
| class Kernel extends HttpKernel | ||||
| { | ||||
|     /** | ||||
|      * The application's global HTTP middleware stack. | ||||
|      * | ||||
|      * These middleware are run during every request to your application. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $middleware = [ | ||||
|         // \App\Http\Middleware\TrustHosts::class,
 | ||||
|         \App\Http\Middleware\TrustProxies::class, | ||||
|         \Fruitcake\Cors\HandleCors::class, | ||||
|         \App\Http\Middleware\PreventRequestsDuringMaintenance::class, | ||||
|         \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, | ||||
|         \App\Http\Middleware\TrimStrings::class, | ||||
|         \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * The application's route middleware groups. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $middlewareGroups = [ | ||||
|         'web' => [ | ||||
|             \App\Http\Middleware\EncryptCookies::class, | ||||
|             \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, | ||||
|             \Illuminate\Session\Middleware\StartSession::class, | ||||
|             // \Illuminate\Session\Middleware\AuthenticateSession::class,
 | ||||
|             \Illuminate\View\Middleware\ShareErrorsFromSession::class, | ||||
|             \App\Http\Middleware\VerifyCsrfToken::class, | ||||
|             \Illuminate\Routing\Middleware\SubstituteBindings::class, | ||||
|         ], | ||||
| 
 | ||||
|         'api' => [ | ||||
|             'throttle:api', | ||||
|             \Illuminate\Routing\Middleware\SubstituteBindings::class, | ||||
|         ], | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * The application's route middleware. | ||||
|      * | ||||
|      * These middleware may be assigned to groups or used individually. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $routeMiddleware = [ | ||||
|         'auth' => \App\Http\Middleware\Authenticate::class, | ||||
|         'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, | ||||
|         'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, | ||||
|         'can' => \Illuminate\Auth\Middleware\Authorize::class, | ||||
|         'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, | ||||
|         'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, | ||||
|         'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, | ||||
|         'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, | ||||
|         'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, | ||||
|     ]; | ||||
| 
 | ||||
|     protected $commands = [ | ||||
|         CreateDatabaseCommand::class | ||||
|     ]; | ||||
| } | ||||
							
								
								
									
										21
									
								
								app/Http/Middleware/Authenticate.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								app/Http/Middleware/Authenticate.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use Illuminate\Auth\Middleware\Authenticate as Middleware; | ||||
| 
 | ||||
| class Authenticate extends Middleware | ||||
| { | ||||
|     /** | ||||
|      * Get the path the user should be redirected to when they are not authenticated. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function redirectTo($request) | ||||
|     { | ||||
|         if (! $request->expectsJson()) { | ||||
|             return route('login'); | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Http/Middleware/EncryptCookies.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Http/Middleware/EncryptCookies.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; | ||||
| 
 | ||||
| class EncryptCookies extends Middleware | ||||
| { | ||||
|     /** | ||||
|      * The names of the cookies that should not be encrypted. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $except = [ | ||||
|         //
 | ||||
|     ]; | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Http/Middleware/PreventRequestsDuringMaintenance.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Http/Middleware/PreventRequestsDuringMaintenance.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware; | ||||
| 
 | ||||
| class PreventRequestsDuringMaintenance extends Middleware | ||||
| { | ||||
|     /** | ||||
|      * The URIs that should be reachable while maintenance mode is enabled. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $except = [ | ||||
|         //
 | ||||
|     ]; | ||||
| } | ||||
							
								
								
									
										32
									
								
								app/Http/Middleware/RedirectIfAuthenticated.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								app/Http/Middleware/RedirectIfAuthenticated.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use App\Providers\RouteServiceProvider; | ||||
| use Closure; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\Auth; | ||||
| 
 | ||||
| class RedirectIfAuthenticated | ||||
| { | ||||
|     /** | ||||
|      * Handle an incoming request. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Request  $request | ||||
|      * @param  \Closure  $next | ||||
|      * @param  string|null  ...$guards | ||||
|      * @return mixed | ||||
|      */ | ||||
|     public function handle(Request $request, Closure $next, ...$guards) | ||||
|     { | ||||
|         $guards = empty($guards) ? [null] : $guards; | ||||
| 
 | ||||
|         foreach ($guards as $guard) { | ||||
|             if (Auth::guard($guard)->check()) { | ||||
|                 return redirect(RouteServiceProvider::HOME); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return $next($request); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										18
									
								
								app/Http/Middleware/TrimStrings.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/Http/Middleware/TrimStrings.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; | ||||
| 
 | ||||
| class TrimStrings extends Middleware | ||||
| { | ||||
|     /** | ||||
|      * The names of the attributes that should not be trimmed. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $except = [ | ||||
|         'password', | ||||
|         'password_confirmation', | ||||
|     ]; | ||||
| } | ||||
							
								
								
									
										20
									
								
								app/Http/Middleware/TrustHosts.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								app/Http/Middleware/TrustHosts.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use Illuminate\Http\Middleware\TrustHosts as Middleware; | ||||
| 
 | ||||
| class TrustHosts extends Middleware | ||||
| { | ||||
|     /** | ||||
|      * Get the host patterns that should be trusted. | ||||
|      * | ||||
|      * @return array | ||||
|      */ | ||||
|     public function hosts() | ||||
|     { | ||||
|         return [ | ||||
|             $this->allSubdomainsOfApplicationUrl(), | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										28
									
								
								app/Http/Middleware/TrustProxies.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								app/Http/Middleware/TrustProxies.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use Illuminate\Http\Middleware\TrustProxies as Middleware; | ||||
| use Illuminate\Http\Request; | ||||
| 
 | ||||
| class TrustProxies extends Middleware | ||||
| { | ||||
|     /** | ||||
|      * The trusted proxies for this application. | ||||
|      * | ||||
|      * @var array|string|null | ||||
|      */ | ||||
|     protected $proxies; | ||||
| 
 | ||||
|     /** | ||||
|      * The headers that should be used to detect proxies. | ||||
|      * | ||||
|      * @var int | ||||
|      */ | ||||
|     protected $headers = | ||||
|         Request::HEADER_X_FORWARDED_FOR | | ||||
|         Request::HEADER_X_FORWARDED_HOST | | ||||
|         Request::HEADER_X_FORWARDED_PORT | | ||||
|         Request::HEADER_X_FORWARDED_PROTO | | ||||
|         Request::HEADER_X_FORWARDED_AWS_ELB; | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Http/Middleware/VerifyCsrfToken.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Http/Middleware/VerifyCsrfToken.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Middleware; | ||||
| 
 | ||||
| use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; | ||||
| 
 | ||||
| class VerifyCsrfToken extends Middleware | ||||
| { | ||||
|     /** | ||||
|      * The URIs that should be excluded from CSRF verification. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $except = [ | ||||
|         //
 | ||||
|     ]; | ||||
| } | ||||
							
								
								
									
										93
									
								
								app/Http/Requests/Auth/LoginRequest.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										93
									
								
								app/Http/Requests/Auth/LoginRequest.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,93 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Requests\Auth; | ||||
| 
 | ||||
| use Illuminate\Auth\Events\Lockout; | ||||
| use Illuminate\Foundation\Http\FormRequest; | ||||
| use Illuminate\Support\Facades\Auth; | ||||
| use Illuminate\Support\Facades\RateLimiter; | ||||
| use Illuminate\Support\Str; | ||||
| use Illuminate\Validation\ValidationException; | ||||
| 
 | ||||
| class LoginRequest extends FormRequest | ||||
| { | ||||
|     /** | ||||
|      * Determine if the user is authorized to make this request. | ||||
|      * | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function authorize() | ||||
|     { | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Get the validation rules that apply to the request. | ||||
|      * | ||||
|      * @return array | ||||
|      */ | ||||
|     public function rules() | ||||
|     { | ||||
|         return [ | ||||
|             'email' => ['required', 'string', 'email'], | ||||
|             'password' => ['required', 'string'], | ||||
|         ]; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Attempt to authenticate the request's credentials. | ||||
|      * | ||||
|      * @return void | ||||
|      * | ||||
|      * @throws \Illuminate\Validation\ValidationException | ||||
|      */ | ||||
|     public function authenticate() | ||||
|     { | ||||
|         $this->ensureIsNotRateLimited(); | ||||
| 
 | ||||
|         if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { | ||||
|             RateLimiter::hit($this->throttleKey()); | ||||
| 
 | ||||
|             throw ValidationException::withMessages([ | ||||
|                 'email' => __('auth.failed'), | ||||
|             ]); | ||||
|         } | ||||
| 
 | ||||
|         RateLimiter::clear($this->throttleKey()); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Ensure the login request is not rate limited. | ||||
|      * | ||||
|      * @return void | ||||
|      * | ||||
|      * @throws \Illuminate\Validation\ValidationException | ||||
|      */ | ||||
|     public function ensureIsNotRateLimited() | ||||
|     { | ||||
|         if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         event(new Lockout($this)); | ||||
| 
 | ||||
|         $seconds = RateLimiter::availableIn($this->throttleKey()); | ||||
| 
 | ||||
|         throw ValidationException::withMessages([ | ||||
|             'email' => trans('auth.throttle', [ | ||||
|                 'seconds' => $seconds, | ||||
|                 'minutes' => ceil($seconds / 60), | ||||
|             ]), | ||||
|         ]); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Get the rate limiting throttle key for the request. | ||||
|      * | ||||
|      * @return string | ||||
|      */ | ||||
|     public function throttleKey() | ||||
|     { | ||||
|         return Str::lower($this->input('email')).'|'.$this->ip(); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Models/DNS.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Models/DNS.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class DNS extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'service_id', 'hostname', 'dns_type', 'address', 'server_id', 'domain_id']; | ||||
| 
 | ||||
|     public static $dns_types = ['A', 'AAAA', 'DNAME', 'MX', 'NS', 'SOA', 'TXT', 'URI']; | ||||
| } | ||||
							
								
								
									
										15
									
								
								app/Models/DiskSpeed.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								app/Models/DiskSpeed.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class DiskSpeed extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $table = 'disk_speed'; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'server_id', 'd_4k', 'd_4k_type', 'd_4k_as_mbps', 'd_64k', 'd_64k_type', 'd_64k_as_mbps', 'd_512k', 'd_512k_type', 'd_512k_as_mbps', 'd_1m', 'd_1m_type', 'd_1m_as_mbps']; | ||||
| } | ||||
							
								
								
									
										15
									
								
								app/Models/Domains.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								app/Models/Domains.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Domains extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'domain', 'extension', 'ns1', 'ns2', 'ns3', 'price', 'currency', 'payment_term', 'owned_since', 'provider_id', 'next_due_date']; | ||||
| } | ||||
							
								
								
									
										27
									
								
								app/Models/Labels.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								app/Models/Labels.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,27 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| 
 | ||||
| class Labels extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'label', 'server_id', 'server_id_2', 'domain_id', 'domain_id_2', 'shared_id', 'shared_id_2']; | ||||
| 
 | ||||
|     public static function deleteLabelsAssignedTo($service_id) | ||||
|     { | ||||
|         DB::table('labels_assigned')->where('service_id', '=', $service_id)->delete(); | ||||
|     } | ||||
| 
 | ||||
|     public static function deleteLabelAssignedAs($label_id) | ||||
|     { | ||||
|         DB::table('labels_assigned')->where('label_id', '=', $label_id)->delete(); | ||||
|     } | ||||
|      | ||||
| } | ||||
							
								
								
									
										15
									
								
								app/Models/Locations.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								app/Models/Locations.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Locations extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $fillable = ['name']; | ||||
| 
 | ||||
|     protected $table = 'locations'; | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Models/Misc.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Models/Misc.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Misc extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| 
 | ||||
|     protected $table = 'misc_services'; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'name', 'owned_since']; | ||||
| } | ||||
							
								
								
									
										15
									
								
								app/Models/NetworkSpeed.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								app/Models/NetworkSpeed.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class NetworkSpeed extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $table = 'network_speed'; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'server_id', 'location', 'send', 'send_type', 'send_as_mbps', 'receive', 'receive_type', 'receive_as_mbps', 'created_at', 'updated_at']; | ||||
| } | ||||
							
								
								
									
										13
									
								
								app/Models/OS.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/Models/OS.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class OS extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $table = 'os'; | ||||
| } | ||||
							
								
								
									
										78
									
								
								app/Models/Pricing.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								app/Models/Pricing.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,78 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| 
 | ||||
| class Pricing extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $fillable = ['service_id', 'service_type', 'currency', 'price', 'term', 'as_usd', 'usd_per_month', 'next_due_date']; | ||||
| 
 | ||||
|     public function convertToUSD(string $amount, string $convert_from): float | ||||
|     { | ||||
|         if ($convert_from === 'AUD') { | ||||
|             return (0.76 * $amount); | ||||
|         } elseif ($convert_from === "USD") { | ||||
|             return $amount; | ||||
|         } elseif ($convert_from === "GBP") { | ||||
|             return (1.35 * $amount); | ||||
|         } elseif ($convert_from === "EUR") { | ||||
|             return (1.23 * $amount); | ||||
|         } elseif ($convert_from === "NZD") { | ||||
|             return (0.72 * $amount); | ||||
|         } elseif ($convert_from === "JPY") { | ||||
|             return (0.0097 * $amount); | ||||
|         } elseif ($convert_from === "CAD") { | ||||
|             return (0.78 * $amount); | ||||
|         } else { | ||||
|             return 1.00; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public function costAsPerMonth(string $cost, int $term): float | ||||
|     { | ||||
|         if ($term === 1) { | ||||
|             return $cost; | ||||
|         } elseif ($term === 2) { | ||||
|             return ($cost / 3); | ||||
|         } elseif ($term === 3) { | ||||
|             return ($cost / 6); | ||||
|         } elseif ($term === 4) { | ||||
|             return ($cost / 12); | ||||
|         } elseif ($term === 5) { | ||||
|             return ($cost / 24); | ||||
|         } elseif ($term === 6) { | ||||
|             return ($cost / 36); | ||||
|         } else { | ||||
|             return $cost; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public function termAsMonths(int $term): int | ||||
|     { | ||||
|         if ($term === 1) { | ||||
|             return 1; | ||||
|         } elseif ($term === 2) { | ||||
|             return 3; | ||||
|         } elseif ($term === 3) { | ||||
|             return 6; | ||||
|         } elseif ($term === 4) { | ||||
|             return 12; | ||||
|         } elseif ($term === 5) { | ||||
|             return 24; | ||||
|         } elseif ($term === 6) { | ||||
|             return 36; | ||||
|         } else { | ||||
|             return 62; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public function deletePricing($id): void | ||||
|     { | ||||
|         DB::table('pricings')->where('service_id', '=', $id)->delete(); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										15
									
								
								app/Models/Providers.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								app/Models/Providers.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Providers extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $fillable = ['name']; | ||||
| 
 | ||||
|     protected $table = 'providers'; | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Models/Reseller.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Models/Reseller.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Reseller extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $table = 'reseller_hosting'; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'active', 'accounts', 'main_domain', 'has_dedicated_ip', 'ip', 'reseller_type', 'provider_id', 'location_id', 'bandwidth', 'disk', 'disk_type', 'disk_as_gb', 'domains_limit', 'subdomains_limit', 'ftp_limit', 'email_limit', 'db_limit', 'was_promo', 'owned_since']; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| } | ||||
							
								
								
									
										153
									
								
								app/Models/Server.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										153
									
								
								app/Models/Server.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,153 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Server extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'hostname', 'ipv4', 'ipv6', 'server_type', 'os_id', 'location_id', 'provider_id', 'ram', 'disk', 'ram_type', 'disk_type', 'ns1', 'ns2', 'label', 'bandwidth', 'ram_as_mb', 'disk_as_gb', 'has_yabs', 'was_promo', 'owned_since', 'ssh', 'active']; | ||||
|     /** | ||||
|      * @var mixed | ||||
|      */ | ||||
|     private $id; | ||||
| 
 | ||||
|     public static function serviceServerType($type) | ||||
|     { | ||||
|         if ($type === 1) { | ||||
|             return "KVM"; | ||||
|         } elseif ($type === 2) { | ||||
|             return "OVZ"; | ||||
|         } elseif ($type === 3) { | ||||
|             return "DEDI"; | ||||
|         } elseif ($type === 4) { | ||||
|             return "LXC"; | ||||
|         } else { | ||||
|             return "SEMI-DEDI"; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public static function osIntToIcon(int $os, string $os_name) | ||||
|     { | ||||
|         if ($os === 1) {//None
 | ||||
|             return "<i class='fas fa-expand' title='{$os_name}'></i>"; | ||||
|         } else if ($os <= 3) {//Centos
 | ||||
|             return "<i class='fab fa-centos os-icon' title='{$os_name}'></i>"; | ||||
|         } elseif ($os > 3 && $os <= 6) {//Debain
 | ||||
|             return "<i class='fab fa-linux os-icon' title='{$os_name}'></i>"; | ||||
|         } elseif ($os > 6 && $os < 10) {//Fedora
 | ||||
|             return "<i class='fab fa-fedora os-icon' title='{$os_name}'></i>"; | ||||
|         } elseif ($os > 10 && $os < 13) {//FreeBSD
 | ||||
|             return "<i class='fab fa-linux os-icon' title='{$os_name}'></i>"; | ||||
|         } elseif ($os > 13 && $os < 16) {//OpenBSD
 | ||||
|             return "<i class='fab fa-linux os-icon' title='{$os_name}'></i>"; | ||||
|         } elseif ($os > 15 && $os < 21) {//Ubuntu
 | ||||
|             return "<i class='fab fa-ubuntu os-icon' title='{$os_name}'></i>"; | ||||
|         } elseif ($os > 20 && $os < 26) {//Windows
 | ||||
|             return "<i class='fab fa-windows os-icon' title='{$os_name}'></i>"; | ||||
|         } else {//OTHER ISO CUSTOM etc
 | ||||
|             return "<i class='fas fa-compact-disc os-icon' title='{$os_name}'></i>"; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public static function osIdAsString($os) | ||||
|     { | ||||
|         if ($os === "0") { | ||||
|             return "None"; | ||||
|         } elseif ($os === "1") { | ||||
|             return "CentOS 7"; | ||||
|         } elseif ($os === "2") { | ||||
|             return "CentOS 8"; | ||||
|         } elseif ($os === "3") { | ||||
|             return "CentOS"; | ||||
|         } elseif ($os === "4") { | ||||
|             return "Debian 9"; | ||||
|         } elseif ($os === "5") { | ||||
|             return "Debian 10"; | ||||
|         } elseif ($os === "6") { | ||||
|             return "Debian"; | ||||
|         } elseif ($os === "7") { | ||||
|             return "Fedora 32"; | ||||
|         } elseif ($os === "8") { | ||||
|             return "Fedora 33"; | ||||
|         } elseif ($os === "9") { | ||||
|             return "Fedora"; | ||||
|         } elseif ($os === "10") { | ||||
|             return "FreeBSD 11.4"; | ||||
|         } elseif ($os === "11") { | ||||
|             return "FreeBSD 12.1"; | ||||
|         } elseif ($os === "12") { | ||||
|             return "FreeBSD"; | ||||
|         } elseif ($os === "13") { | ||||
|             return "OpenBSD 6.7"; | ||||
|         } elseif ($os === "14") { | ||||
|             return "OpenBSD 6.8"; | ||||
|         } elseif ($os === "15") { | ||||
|             return "OpenBSD"; | ||||
|         } elseif ($os == "16") { | ||||
|             return "Ubuntu 16.04"; | ||||
|         } elseif ($os === "17") { | ||||
|             return "Ubuntu 18.04"; | ||||
|         } elseif ($os === "18") { | ||||
|             return "Ubuntu 20.04"; | ||||
|         } elseif ($os === "19") { | ||||
|             return "Ubuntu 20.10"; | ||||
|         } elseif ($os === "20") { | ||||
|             return "Ubuntu"; | ||||
|         } elseif ($os === "21") { | ||||
|             return "Windows Server 2008"; | ||||
|         } elseif ($os === "22") { | ||||
|             return "Windows Server 2012"; | ||||
|         } elseif ($os === "23") { | ||||
|             return "Windows Server 2016"; | ||||
|         } elseif ($os === "24") { | ||||
|             return "Windows Server 2019"; | ||||
|         } elseif ($os === "25") { | ||||
|             return "Windows 10"; | ||||
|         } elseif ($os === "26") { | ||||
|             return "Custom"; | ||||
|         } elseif ($os === "27") { | ||||
|             return "Other"; | ||||
|         } else { | ||||
|             return "Unknown"; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public static function tableRowCompare(string $val1, string $val2, string $value_type = '', bool $is_int = true) | ||||
|     { | ||||
|         //<td class="td-nowrap plus-td">+303<span class="data-type">MBps</span></td>
 | ||||
|         $str = '<td class="td-nowrap '; | ||||
|         $value_append = '<span class="data-type">' . $value_type . '</span>'; | ||||
|         if ($is_int) { | ||||
|             $val1 = (int)$val1; | ||||
|             $val2 = (int)$val2; | ||||
|         } | ||||
|         if ($val1 > $val2) {//val1 is greater than val2
 | ||||
|             $result = '+' . ($val1 - $val2); | ||||
|             if (!empty($value_type)) { | ||||
|                 $result = '+' . ($val1 - $val2) . $value_append; | ||||
| 
 | ||||
|             } | ||||
|             $str .= 'plus-td">' . $result . '</td>'; | ||||
|         } elseif ($val1 < $val2) {//val1 is less than val2
 | ||||
|             $result = '-' . ($val2 - $val1); | ||||
|             if (!empty($value_type)) { | ||||
|                 $result = '-' . ($val2 - $val1) . $value_append; | ||||
|             } | ||||
|             $str .= 'neg-td">' . $result . '</td>'; | ||||
|         } else {//Equal
 | ||||
|             $result = 0; | ||||
|             if (!empty($value_type)) { | ||||
|                 $result = '0' . $value_append; | ||||
|             } | ||||
|             $str .= 'equal-td">' . $result . '</td>'; | ||||
|         } | ||||
|         return $str; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										13
									
								
								app/Models/Settings.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/Models/Settings.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Settings extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     protected $table = 'settings'; | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Models/Shared.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Models/Shared.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Shared extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     public $table = 'shared_hosting'; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'active', 'main_domain', 'has_dedicated_ip', 'ip', 'shared_type', 'provider_id', 'location_id', 'bandwidth', 'disk', 'disk_type', 'disk_as_gb', 'domains_limit', 'subdomains_limit', 'ftp_limit', 'email_limit', 'db_limit', 'was_promo', 'owned_since']; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| } | ||||
							
								
								
									
										44
									
								
								app/Models/User.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								app/Models/User.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,44 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Contracts\Auth\MustVerifyEmail; | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Foundation\Auth\User as Authenticatable; | ||||
| use Illuminate\Notifications\Notifiable; | ||||
| 
 | ||||
| class User extends Authenticatable | ||||
| { | ||||
|     use HasFactory, Notifiable; | ||||
| 
 | ||||
|     /** | ||||
|      * The attributes that are mass assignable. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $fillable = [ | ||||
|         'name', | ||||
|         'email', | ||||
|         'password', | ||||
|         'api_token' | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * The attributes that should be hidden for arrays. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $hidden = [ | ||||
|         'password', | ||||
|         'remember_token', | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * The attributes that should be cast to native types. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $casts = [ | ||||
|         'email_verified_at' => 'datetime', | ||||
|     ]; | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Models/Yabs.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Models/Yabs.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Yabs extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| 
 | ||||
|     public $incrementing = false; | ||||
| 
 | ||||
|     protected $table = 'yabs'; | ||||
| 
 | ||||
|     protected $fillable = ['id', 'server_id', 'has_ipv6', 'aes', 'vm', 'output_date', 'cpu_cores', 'cpu_freq', 'cpu', 'ram', 'ram_type', 'ram_mb', 'disk', 'disk_type', 'disk_gb', 'gb5_single', 'gb5_multi', 'gb5_id', '4k', '4k_type', '4k_as_mbps', '64k', '64k_type', '64k_as_mbps', '512k', '512k_type', '512k_as_mbps', '1m', '1m_type', '1m_as_mbps', 'location', 'send', 'send_type', 'send_as_mbps', 'receive', 'receive_type', 'receive_as_mbps']; | ||||
| } | ||||
							
								
								
									
										353
									
								
								app/Process.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										353
									
								
								app/Process.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,353 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App; | ||||
| 
 | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Facades\Storage; | ||||
| 
 | ||||
| class Process | ||||
| { | ||||
|     public string $start_time; | ||||
|     public string $end_time; | ||||
| 
 | ||||
|     public function startTimer(): void | ||||
|     { | ||||
|         $this->start_time = microtime(true); | ||||
|     } | ||||
| 
 | ||||
|     public function stopTimer(): void | ||||
|     { | ||||
|         $this->end_time = microtime(true); | ||||
|     } | ||||
| 
 | ||||
|     public function getTimeTaken(): float | ||||
|     {//In seconds
 | ||||
|         return ($this->end_time - $this->start_time) * 100; | ||||
|     } | ||||
| 
 | ||||
|     public static function paymentTermIntToString(int $term): string | ||||
|     { | ||||
|         if ($term === 1) { | ||||
|             return "p/m"; | ||||
|         } elseif ($term === 2) { | ||||
|             return "p/qtr"; | ||||
|         } elseif ($term === 3) { | ||||
|             return "p/hy"; | ||||
|         } elseif ($term === 4) { | ||||
|             return "p/y"; | ||||
|         } elseif ($term === 5) { | ||||
|             return "p/2y"; | ||||
|         } elseif ($term === 6) { | ||||
|             return "p/3y"; | ||||
|         } else { | ||||
|             return "unknown"; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private function floatValue(string $string): float | ||||
|     {//Keeps only numbers and . AKA a float
 | ||||
|         return preg_replace('/[^0-9,.]/', '', trim($string)); | ||||
|     } | ||||
| 
 | ||||
|     private function intValue(string $string): int | ||||
|     {//Keeps only numbers AKA an int
 | ||||
|         return (int)preg_replace('/[^0-9]/', '', trim($string)); | ||||
|     } | ||||
| 
 | ||||
|     private function removeFloat(string $string): string | ||||
|     {//Removes float from a string
 | ||||
|         return ltrim(preg_replace('/[^A-Za-z\-,.]/', '', $string), '.'); | ||||
|     } | ||||
| 
 | ||||
|     private function trimRemoveR(string $string): string | ||||
|     {//Removes \r and does a trim()
 | ||||
|         return trim(str_replace("\r", '', $string)); | ||||
|     } | ||||
| 
 | ||||
|     private function datatype(string $string): string | ||||
|     {//Formats data type (ram and disk)
 | ||||
|         if (str_contains($string, 'M')) { | ||||
|             return 'MB';//Megabytes
 | ||||
|         } elseif (str_contains($string, 'G')) { | ||||
|             return 'GB';//Gigabytes
 | ||||
|         } elseif (str_contains($string, 'K')) { | ||||
|             return 'KB';//Kilobytes
 | ||||
|         } elseif (str_contains($string, 'T')) { | ||||
|             return 'TB';//TeraBytes
 | ||||
|         } elseif (str_contains($string, 'B')) { | ||||
|             return 'BT';//Bytes
 | ||||
|         } else { | ||||
|             return "GB"; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private function GBtoMB(string $gb): float | ||||
|     {//Gigabyte to Megabyte conversion
 | ||||
|         return ($gb * 1024); | ||||
|     } | ||||
| 
 | ||||
|     private function TBtoGB(string $tb): float | ||||
|     {//Terabyte to Gigabyte conversion
 | ||||
|         return ($tb * 1024); | ||||
|     } | ||||
| 
 | ||||
|     private function GBpstoMBps(string $gbps, bool $format = false): float | ||||
|     {//Gigabits to Megabits
 | ||||
|         if ($format) { | ||||
|             return (float)number_format(((float)$gbps * 1000), 3); | ||||
|         } | ||||
|         return (float)$gbps * 1000; | ||||
|     } | ||||
| 
 | ||||
|     private function diskSpeedAsMbps(string $type, string $value): float | ||||
|     {//If value type GB/s convert to MB/s, KB/s to MB/s
 | ||||
|         if ($type === "GB/s") { | ||||
|             return $this->GBpstoMBps($value); | ||||
|         } | ||||
|         if ($type === "KB/s") { | ||||
|             return (float)($value / 1000); | ||||
|         } | ||||
|         return $value; | ||||
|     } | ||||
| 
 | ||||
|     private function networkSpeedAsMbps(string $type, string $value): float | ||||
|     {//If value type GBps convert to MB/s
 | ||||
|         if ($type === "GBps") { | ||||
|             return $this->GBpstoMBps($value); | ||||
|         } | ||||
|         return $value; | ||||
|     } | ||||
| 
 | ||||
|     private function yabsSpeedValues(array $data): array | ||||
|     {//Formats YABs speed test for speed value and type as array
 | ||||
|         $data = explode('|', implode($data)); | ||||
|         if ($data[2] === 'busy') { | ||||
|             $send = $send_type = NULL; | ||||
|         } else { | ||||
|             $send = (float)$data[2]; | ||||
|             if ($this->removeFloat($data[2]) === 'Mbitssec') { | ||||
|                 $send_type = "MBps"; | ||||
|             } elseif ($this->removeFloat($data[2]) === 'Gbitssec') { | ||||
|                 $send_type = "GBps"; | ||||
|             } elseif ($this->removeFloat($data[2]) === 'Kbitssec') { | ||||
|                 $send_type = "KBps"; | ||||
|             } else { | ||||
|                 $send_type = $this->removeFloat($data[2]); | ||||
|             } | ||||
|         } | ||||
|         if ($data[3] === 'busy') { | ||||
|             $receive = $receive_type = NULL; | ||||
|         } else { | ||||
|             $receive = (float)$data[3]; | ||||
|             if ($this->removeFloat($data[3]) === 'Mbitssec') { | ||||
|                 $receive_type = "MBps"; | ||||
|             } elseif ($this->removeFloat($data[3]) === 'Gbitssec') { | ||||
|                 $receive_type = "GBps"; | ||||
|             } elseif ($this->removeFloat($data[3]) === 'Kbitssec') { | ||||
|                 $receive_type = "KBps"; | ||||
|             } else { | ||||
|                 $receive_type = $this->removeFloat($data[3]); | ||||
|             } | ||||
|         } | ||||
|         return array('send' => $send, 'send_type' => $send_type, 'receive' => $receive, 'receive_type' => $receive_type); | ||||
|     } | ||||
| 
 | ||||
|     private function yabsSpeedLoc(array $data): array | ||||
|     {//Formats YABs speed test provider and location as array
 | ||||
|         if ($data[1] === '|') { | ||||
|             $provider = $data[0]; | ||||
|         } else { | ||||
|             $provider = $data[0] . ' ' . $data[1]; | ||||
|         } | ||||
|         if ($data[2] !== '|') { | ||||
|             $location = $data[2] . ' ' . str_replace(',', '', $data[3]); | ||||
|         } else { | ||||
|             $location = $data[3] . ' ' . str_replace(',', '', $data[4]); | ||||
|         } | ||||
|         return array('provider' => $provider, 'location' => $location); | ||||
|     } | ||||
| 
 | ||||
|     public function yabsOutputAsJson(string $server_id, string $data_from_form): array | ||||
|     { | ||||
|         $file_name = 'tempYabs.txt'; | ||||
| 
 | ||||
|         Storage::disk('local')->put($file_name, $data_from_form); | ||||
| 
 | ||||
|         $file = Storage::disk('local')->get($file_name); | ||||
| 
 | ||||
|         if ($file) { | ||||
|             $array = explode("\n", $file); | ||||
|             Storage::disk('local')->delete($file_name);//Delete file
 | ||||
|         } else { | ||||
|             return array('error_id' => 10, 'error_message' => 'Issue writing/reading txt file'); | ||||
|         } | ||||
| 
 | ||||
|         if (count($array) < 47) { | ||||
|             return array('error_id' => 9, 'error_message' => 'Less than 47 lines'); | ||||
|         } | ||||
| 
 | ||||
|         if (str_contains($array[0], "# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #\r")) { | ||||
|             if ($array[1] !== "#              Yet-Another-Bench-Script              #\r") { | ||||
|                 return array('error_id' => 8, 'error_message' => 'Didnt copy output correctly'); | ||||
|             } | ||||
| 
 | ||||
|             $version_array = explode(' ', preg_replace('!\s+!', ' ', $this->trimRemoveR($array[2]))); | ||||
|             if ($version_array[1] === 'v2021-12-28') {//YABs version
 | ||||
|                 $cpu = $this->trimRemoveR(str_replace(':', '', strstr($array[10], ': '))); | ||||
|                 $cpu_spec = explode(' ', strstr($array[11], ': '));//: 2 @ 3792.872 MHz
 | ||||
|                 $cpu_cores = $cpu_spec[1]; | ||||
|                 $cpu_freq = $cpu_spec[3]; | ||||
|                 $ram_line = $this->trimRemoveR(str_replace(':', '', strstr($array[14], ': '))); | ||||
|                 $ram = (float)$ram_line; | ||||
|                 $ram_type = $this->datatype($ram_line); | ||||
|                 $swap_line = $this->trimRemoveR(str_replace(':', '', strstr($array[15], ': '))); | ||||
|                 $swap = (float)$swap_line; | ||||
|                 $swap_type = $this->datatype($swap_line); | ||||
|                 $disk_line = $this->trimRemoveR(str_replace(':', '', strstr($array[16], ': '))); | ||||
|                 $disk = (float)$disk_line; | ||||
|                 $disk_type = $this->datatype($disk_line); | ||||
|                 $io_3 = explode(' ', preg_replace('!\s+!', ' ', $array[24])); | ||||
|                 $io_6 = explode(' ', preg_replace('!\s+!', ' ', $array[30])); | ||||
|                 (str_contains($array[12], 'Enabled')) ? $aes_ni = true : $aes_ni = false; | ||||
|                 (str_contains($array[13], 'Enabled')) ? $vm_amd_v = true : $vm_amd_v = false; | ||||
| 
 | ||||
|                 $d4k_as_mbps = $this->diskSpeedAsMbps($io_3[3], $this->floatValue($io_3[2])); | ||||
|                 $d64k_as_mbps = $this->diskSpeedAsMbps($io_3[7], $this->floatValue($io_3[6])); | ||||
|                 $d512k_as_mbps = $this->diskSpeedAsMbps($io_6[3], $this->floatValue($io_6[2])); | ||||
|                 $d1m_as_mbps = $this->diskSpeedAsMbps($io_6[7], $this->floatValue($io_6[6])); | ||||
|                 $disk_test_arr = array( | ||||
|                     '4k_total' => $this->floatValue($io_3[2]), | ||||
|                     '4k_total_type' => $io_3[3], | ||||
|                     '4k_total_mbps' => $d4k_as_mbps, | ||||
|                     '64k_total' => $this->floatValue($io_3[6]), | ||||
|                     '64k_total_type' => $io_3[7], | ||||
|                     '64k_total_mbps' => $d64k_as_mbps, | ||||
|                     '512k_total' => $this->floatValue($io_6[2]), | ||||
|                     '512k_total_type' => $io_6[3], | ||||
|                     '512k_total_mbps' => $d512k_as_mbps, | ||||
|                     '1m_total' => $this->floatValue($io_6[6]), | ||||
|                     '1m_total_type' => $io_6[7], | ||||
|                     '1m_total_mbps' => $d1m_as_mbps, | ||||
|                 ); | ||||
| 
 | ||||
|                 if (isset($array[40])) { | ||||
|                     if ($array[45] === "Geekbench 5 Benchmark Test:\r") { | ||||
|                         //No ipv6
 | ||||
|                         //Has short ipv4 network speed testing (-r)
 | ||||
|                         $has_ipv6 = false; | ||||
|                         $start_st = 36; | ||||
|                         $end_st = 43; | ||||
|                         $gb_s = 49; | ||||
|                         $gb_m = 50; | ||||
|                         $gb_url = 51; | ||||
|                     } elseif ($array[45] === "Geekbench 4 Benchmark Test:\r") { | ||||
|                         return array('error_id' => 6, 'error_message' => 'GeekBench 5 only allowed'); | ||||
|                     } elseif ($array[45] === "Geekbench 5 test failed. Run manually to determine cause.\r") { | ||||
|                         return array('error_id' => 7, 'error_message' => 'GeekBench test failed'); | ||||
|                     } elseif ($array[40] === "Geekbench 5 Benchmark Test:\r") { | ||||
|                         //No ipv6
 | ||||
|                         //Has full ipv4 network speed testing
 | ||||
|                         $has_ipv6 = false; | ||||
|                         $start_st = 36; | ||||
|                         $end_st = 38; | ||||
|                         $gb_s = 44; | ||||
|                         $gb_m = 45; | ||||
|                         $gb_url = 46; | ||||
|                     } elseif ($array[40] === "iperf3 Network Speed Tests (IPv6):\r") { | ||||
|                         //HAS ipv6
 | ||||
|                         //Has short ipv4 & ipv6 network speed testing
 | ||||
|                         $has_ipv6 = true; | ||||
|                         $start_st = 36; | ||||
|                         $end_st = 38; | ||||
|                         $gb_s = 52; | ||||
|                         $gb_m = 53; | ||||
|                         $gb_url = 54; | ||||
|                     } elseif ($array[56] === "Geekbench 5 Benchmark Test:\r") { | ||||
|                         //HAS ipv6
 | ||||
|                         //Has full ipv4 & ipv6 network speed testing
 | ||||
|                         $has_ipv6 = true; | ||||
|                         $start_st = 36; | ||||
|                         $end_st = 43; | ||||
|                         $gb_s = 60; | ||||
|                         $gb_m = 61; | ||||
|                         $gb_url = 62; | ||||
|                     } else { | ||||
|                         return array('error_id' => 5, 'error_message' => 'Not correct YABs command output'); | ||||
|                     } | ||||
|                 } else { | ||||
|                     return array('error_id' => 4, 'error_message' => 'Not correct formatting'); | ||||
|                 } | ||||
|                 $geekbench_single = $this->intValue($array[$gb_s]); | ||||
|                 $geekbench_multi = $this->intValue($array[$gb_m]); | ||||
|                 $geek_full_url = explode(' ', preg_replace('!\s+!', ' ', $array[$gb_url])); | ||||
|                 $gb5_id = (int)substr($geek_full_url[3], strrpos($geek_full_url[3], '/') + 1);//
 | ||||
|                 $has_a_speed_test = false; | ||||
| 
 | ||||
|                 ($ram_type === 'GB') ? $ram_mb = $this->GBtoMB($ram) : $ram_mb = $ram; | ||||
|                 ($swap_type === 'GB') ? $swap_mb = $this->GBtoMB($swap) : $swap_mb = $swap; | ||||
|                 ($disk_type === 'TB') ? $disk_gb = $this->TBtoGB($disk) : $disk_gb = $disk; | ||||
| 
 | ||||
|                 $date = date_create($array[6]); | ||||
| 
 | ||||
|                 $output = [ | ||||
|                     'id' => $server_id, | ||||
|                     'has_ipv6' => $has_ipv6, | ||||
|                     'output_date' => date_format($date, 'Y-m-d H:i:s'), | ||||
|                     'process_date' => date('Y-m-d H:i:s'), | ||||
|                     'cpu_cores' => (int)$cpu_cores, | ||||
|                     'cpu_freq' => (float)$cpu_freq, | ||||
|                     'cpu' => $cpu, | ||||
|                     'ram' => $ram, | ||||
|                     'ram_type' => $ram_type, | ||||
|                     'ram_mb' => $ram_mb, | ||||
|                     'swap' => $swap, | ||||
|                     'swap_type' => $swap_type, | ||||
|                     'swap_mb' => $swap_mb, | ||||
|                     'disk' => $disk, | ||||
|                     'disk_type' => $disk_type, | ||||
|                     'disk_gb' => $disk_gb, | ||||
|                     'aes' => $aes_ni, | ||||
|                     'vm' => $vm_amd_v, | ||||
|                     'GB5_single' => $geekbench_single, | ||||
|                     'GB5_mult' => $geekbench_multi, | ||||
|                     'GB5_id' => $gb5_id | ||||
|                 ]; | ||||
| 
 | ||||
|                 $output['disk_speed'] = $disk_test_arr; | ||||
| 
 | ||||
|                 $speed_test_arr = array(); | ||||
| 
 | ||||
|                 for ($i = $start_st; $i <= $end_st; $i++) { | ||||
|                     if (str_contains($array[$i], 'busy')) { | ||||
|                         //Has a "busy" result, No insert
 | ||||
|                     } else { | ||||
|                         $data = explode(' ', preg_replace('!\s+!', ' ', $array[$i])); | ||||
|                         $send_as_mbps = $this->networkSpeedAsMbps($this->yabsSpeedValues($data)['send_type'], $this->yabsSpeedValues($data)['send']); | ||||
|                         $recieve_as_mbps = $this->networkSpeedAsMbps($this->yabsSpeedValues($data)['receive_type'], $this->yabsSpeedValues($data)['receive']); | ||||
|                         $speed_test_arr[] = array( | ||||
|                             'location' => $this->yabsSpeedLoc($data)['location'], | ||||
|                             'send' => $this->yabsSpeedValues($data)['send'], | ||||
|                             'send_type' => $this->yabsSpeedValues($data)['send_type'], | ||||
|                             'send_type_mbps' => $send_as_mbps, | ||||
|                             'receive' => $this->yabsSpeedValues($data)['receive'], | ||||
|                             'receive_type' => $this->yabsSpeedValues($data)['receive_type'], | ||||
|                             'receive_type_mbps' => $recieve_as_mbps | ||||
|                         ); | ||||
|                         $has_a_speed_test = true; | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 if ($has_a_speed_test) { | ||||
|                     $output['network_speed'] = $speed_test_arr; | ||||
|                 } | ||||
|                 return $output; | ||||
|             } else { | ||||
|                 return array('error_id' => 4, 'error_message' => 'Wrong YABs version'); | ||||
|             } | ||||
|         } else { | ||||
|             return array('error_id' => 3, 'error_message' => 'Didnt start at right spot'); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										28
									
								
								app/Providers/AppServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								app/Providers/AppServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Providers; | ||||
| 
 | ||||
| use Illuminate\Support\ServiceProvider; | ||||
| 
 | ||||
| class AppServiceProvider extends ServiceProvider | ||||
| { | ||||
|     /** | ||||
|      * Register any application services. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function register() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Bootstrap any application services. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function boot() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										30
									
								
								app/Providers/AuthServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								app/Providers/AuthServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,30 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Providers; | ||||
| 
 | ||||
| use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; | ||||
| use Illuminate\Support\Facades\Gate; | ||||
| 
 | ||||
| class AuthServiceProvider extends ServiceProvider | ||||
| { | ||||
|     /** | ||||
|      * The policy mappings for the application. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $policies = [ | ||||
|         // 'App\Models\Model' => 'App\Policies\ModelPolicy',
 | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * Register any authentication / authorization services. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function boot() | ||||
|     { | ||||
|         $this->registerPolicies(); | ||||
| 
 | ||||
|         //
 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										21
									
								
								app/Providers/BroadcastServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								app/Providers/BroadcastServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Providers; | ||||
| 
 | ||||
| use Illuminate\Support\Facades\Broadcast; | ||||
| use Illuminate\Support\ServiceProvider; | ||||
| 
 | ||||
| class BroadcastServiceProvider extends ServiceProvider | ||||
| { | ||||
|     /** | ||||
|      * Bootstrap any application services. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function boot() | ||||
|     { | ||||
|         Broadcast::routes(); | ||||
| 
 | ||||
|         require base_path('routes/channels.php'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										32
									
								
								app/Providers/EventServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								app/Providers/EventServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Providers; | ||||
| 
 | ||||
| use Illuminate\Auth\Events\Registered; | ||||
| use Illuminate\Auth\Listeners\SendEmailVerificationNotification; | ||||
| use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | ||||
| use Illuminate\Support\Facades\Event; | ||||
| 
 | ||||
| class EventServiceProvider extends ServiceProvider | ||||
| { | ||||
|     /** | ||||
|      * The event listener mappings for the application. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     protected $listen = [ | ||||
|         Registered::class => [ | ||||
|             SendEmailVerificationNotification::class, | ||||
|         ], | ||||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * Register any events for your application. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function boot() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										63
									
								
								app/Providers/RouteServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								app/Providers/RouteServiceProvider.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,63 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Providers; | ||||
| 
 | ||||
| use Illuminate\Cache\RateLimiting\Limit; | ||||
| use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; | ||||
| use Illuminate\Http\Request; | ||||
| use Illuminate\Support\Facades\RateLimiter; | ||||
| use Illuminate\Support\Facades\Route; | ||||
| 
 | ||||
| class RouteServiceProvider extends ServiceProvider | ||||
| { | ||||
|     /** | ||||
|      * The path to the "home" route for your application. | ||||
|      * | ||||
|      * This is used by Laravel authentication to redirect users after login. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     public const HOME = '/dashboard'; | ||||
| 
 | ||||
|     /** | ||||
|      * The controller namespace for the application. | ||||
|      * | ||||
|      * When present, controller route declarations will automatically be prefixed with this namespace. | ||||
|      * | ||||
|      * @var string|null | ||||
|      */ | ||||
|     // protected $namespace = 'App\\Http\\Controllers';
 | ||||
| 
 | ||||
|     /** | ||||
|      * Define your route model bindings, pattern filters, etc. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function boot() | ||||
|     { | ||||
|         $this->configureRateLimiting(); | ||||
| 
 | ||||
|         $this->routes(function () { | ||||
|             Route::prefix('api') | ||||
|                 ->middleware('api') | ||||
|                 ->namespace($this->namespace) | ||||
|                 ->group(base_path('routes/api.php')); | ||||
| 
 | ||||
|             Route::middleware('web') | ||||
|                 ->namespace($this->namespace) | ||||
|                 ->group(base_path('routes/web.php')); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Configure the rate limiters for the application. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     protected function configureRateLimiting() | ||||
|     { | ||||
|         RateLimiter::for('api', function (Request $request) { | ||||
|             return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); | ||||
|         }); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										18
									
								
								app/View/Components/AppLayout.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/AppLayout.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class AppLayout extends Component | ||||
| { | ||||
|     /** | ||||
|      * Get the view / contents that represents the component. | ||||
|      * | ||||
|      * @return \Illuminate\View\View | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('layouts.app'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										19
									
								
								app/View/Components/CurrencySelect.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								app/View/Components/CurrencySelect.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class CurrencySelect extends Component | ||||
| { | ||||
| 
 | ||||
|     /** | ||||
|      * Get the view / contents that represent the component. | ||||
|      * | ||||
|      * @return \Illuminate\Contracts\View\View|\Closure|string | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('components.currency-select'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										18
									
								
								app/View/Components/GuestLayout.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/GuestLayout.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class GuestLayout extends Component | ||||
| { | ||||
|     /** | ||||
|      * Get the view / contents that represents the component. | ||||
|      * | ||||
|      * @return \Illuminate\View\View | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('layouts.guest'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										21
									
								
								app/View/Components/LabelsSelect.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								app/View/Components/LabelsSelect.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use App\Models\Labels; | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class LabelsSelect extends Component | ||||
| { | ||||
|     /** | ||||
|      * Get the view / contents that represent the component. | ||||
|      * | ||||
|      * @return \Illuminate\Contracts\View\View|\Closure|string | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('components.labels-select', [ | ||||
|             'labels' => Labels::all() | ||||
|         ]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										21
									
								
								app/View/Components/LocationsSelect.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								app/View/Components/LocationsSelect.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use App\Models\Locations; | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class LocationsSelect extends Component | ||||
| { | ||||
|     /** | ||||
|      * Get the view / contents that represent the component. | ||||
|      * | ||||
|      * @return \Illuminate\Contracts\View\View|\Closure|string | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('components.locations-select', [ | ||||
|             'locations' => Locations::all() | ||||
|         ]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										28
									
								
								app/View/Components/PricingSelect.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								app/View/Components/PricingSelect.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class PricingSelect extends Component | ||||
| { | ||||
|     /** | ||||
|      * Create a new component instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Get the view / contents that represent the component. | ||||
|      * | ||||
|      * @return \Illuminate\Contracts\View\View|\Closure|string | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('components.pricing-select'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										22
									
								
								app/View/Components/ProvidersSelect.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								app/View/Components/ProvidersSelect.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use App\Models\Providers; | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class ProvidersSelect extends Component | ||||
| { | ||||
| 
 | ||||
|     /** | ||||
|      * Get the view / contents that represent the component. | ||||
|      * | ||||
|      * @return \Illuminate\Contracts\View\View|\Closure|string | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('components.providers-select', [ | ||||
|             'providers' => Providers::all() | ||||
|         ]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										28
									
								
								app/View/Components/TermSelect.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								app/View/Components/TermSelect.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\View\Components; | ||||
| 
 | ||||
| use Illuminate\View\Component; | ||||
| 
 | ||||
| class TermSelect extends Component | ||||
| { | ||||
|     /** | ||||
|      * Create a new component instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         //
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Get the view / contents that represent the component. | ||||
|      * | ||||
|      * @return \Illuminate\Contracts\View\View|\Closure|string | ||||
|      */ | ||||
|     public function render() | ||||
|     { | ||||
|         return view('components.term-select'); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										5
									
								
								assets/css/all.min.css
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								assets/css/all.min.css
									
										
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1569
									
								
								assets/css/style.css
									
										
									
									
									
								
							
							
						
						
									
										1569
									
								
								assets/css/style.css
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 13 KiB | 
							
								
								
									
										2
									
								
								assets/js/bootstrap.min.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								assets/js/bootstrap.min.js
									
										
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1
									
								
								assets/js/jquery.min.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								assets/js/jquery.min.js
									
										
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										556
									
								
								assets/js/scripts.min.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										556
									
								
								assets/js/scripts.min.js
									
										
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| Before Width: | Height: | Size: 730 KiB | 
										
											Binary file not shown.
										
									
								
							Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		
		Reference in a new issue