diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6537ca4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7ea8753 --- /dev/null +++ b/.env.example @@ -0,0 +1,49 @@ +APP_NAME=MyIdlers +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack +LOG_LEVEL=debug + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=my_idlers +DB_USERNAME=root +DB_PASSWORD= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +MEMCACHED_HOST=127.0.0.1 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=mailhog +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..967315d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +* text=auto +*.css linguist-vendored +*.scss linguist-vendored +*.js linguist-vendored +CHANGELOG.md export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7acef30 --- /dev/null +++ b/.gitignore @@ -0,0 +1,75 @@ +### Laravel ### +vendor/ +node_modules/ +npm-debug.log + +# Laravel 4 specific +bootstrap/compiled.php +app/storage/ + +# Laravel 5 & Lumen specific +public/storage +public/hot +storage/*.key +.env.*.php +.env.php +.env +Homestead.yaml +Homestead.json + +# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer +.rocketeer/ + +# Created by https://www.gitignore.io/api/phpstorm + +### PhpStorm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### PhpStorm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000..9231873 --- /dev/null +++ b/.styleci.yml @@ -0,0 +1,13 @@ +php: + preset: laravel + disabled: + - no_unused_imports + finder: + not-name: + - index.php + - server.php +js: + finder: + not-name: + - webpack.mix.js +css: true diff --git a/app/Http/Controllers/IPsController.php b/app/Http/Controllers/IPsController.php new file mode 100644 index 0000000..df3ef59 --- /dev/null +++ b/app/Http/Controllers/IPsController.php @@ -0,0 +1,59 @@ +validate([ + 'address' => 'required|ip|min:2', + 'ip_type' => 'required' + ]); + + $ip_id = Str::random(8); + + IPs::create([ + 'id' => $ip_id, + 'address' => $request->address, + 'is_ipv4' => ($request->ip_type === 'ipv4') ? 1 : 0, + 'service_id' => $request->service_id, + 'active' => 1 + ]); + + return redirect()->route('IPs.index') + ->with('success', 'IP address created Successfully.'); + } + + public function destroy(IPs $IP) + { + $items = IPs::find($IP->id); + $items->delete(); + + return redirect()->route('IPs.index') + ->with('success', 'IP address was deleted Successfully.'); + } +} diff --git a/app/Http/Controllers/OsController.php b/app/Http/Controllers/OsController.php new file mode 100644 index 0000000..784b6b5 --- /dev/null +++ b/app/Http/Controllers/OsController.php @@ -0,0 +1,49 @@ +validate([ + 'os_name' => 'required|min:2' + ]); + + OS::create([ + 'name' => $request->os_name + ]); + + Cache::forget('all_os'); + + return redirect()->route('os.index') + ->with('success', 'OS Created Successfully.'); + } + + public function destroy(OS $o) + { + $items = OS::find($o->id); + + $items->delete(); + + Cache::forget('all_os'); + + return redirect()->route('os.index') + ->with('success', 'OS was deleted Successfully.'); + } +} diff --git a/app/Models/IPs.php b/app/Models/IPs.php new file mode 100644 index 0000000..8ebb264 --- /dev/null +++ b/app/Models/IPs.php @@ -0,0 +1,24 @@ +where('service_id', '=', $service_id)->delete(); + } + +} diff --git a/app/View/Components/OsSelect.php b/app/View/Components/OsSelect.php new file mode 100644 index 0000000..e7f8b07 --- /dev/null +++ b/app/View/Components/OsSelect.php @@ -0,0 +1,20 @@ + $all_os + ]); + } +} diff --git a/artisan b/artisan new file mode 100644 index 0000000..5c23e2e --- /dev/null +++ b/artisan @@ -0,0 +1,53 @@ +#!/usr/bin/env php +make(Illuminate\Contracts\Console\Kernel::class); + +$status = $kernel->handle( + $input = new Symfony\Component\Console\Input\ArgvInput, + new Symfony\Component\Console\Output\ConsoleOutput +); + +/* +|-------------------------------------------------------------------------- +| Shutdown The Application +|-------------------------------------------------------------------------- +| +| Once Artisan has finished running, we will fire off the shutdown events +| so that any final work may be done by the application before we shut +| down the process. This is the last thing to happen to the request. +| +*/ + +$kernel->terminate($input, $status); + +exit($status); diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..35a9aa5 --- /dev/null +++ b/composer.json @@ -0,0 +1,70 @@ +{ + "name": "corbpie/myidlers", + "type": "project", + "description": "Web app for displaying, organizing and storing information about servers, shared/reseller hosting and domains.", + "keywords": [ + "myidlers", + "crud", + "vps", + "organization" + ], + "license": "MIT", + "require": { + "php": "^7.4|^8.0", + "fruitcake/laravel-cors": "^2.0", + "guzzlehttp/guzzle": "^7.0.1", + "laravel/framework": "^9.0", + "laravel/tinker": "^2.5", + "laravel/ui": "^3.4", + "yajra/laravel-datatables-oracle": "~9.0", + "ext-json": "*" + }, + "require-dev": { + "fakerphp/faker": "^1.9.1", + "laravel/breeze": "^1.8", + "laravel/sail": "^1.0.1", + "mockery/mockery": "^1.4.2", + "nunomaduro/collision": "^6.0", + "phpunit/phpunit": "^9.3.3", + "spatie/laravel-ignition": "^1.0" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "files": [ + "app/Process.php" + ], + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Factories\\": "database/factories/", + "Database\\Seeders\\": "database/seeders/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover --ansi" + ], + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "@php artisan key:generate --ansi" + ] + } +}