diff --git a/app/Console/Commands/createUsefulLink.php b/app/Console/Commands/createUsefulLink.php
new file mode 100644
index 00000000..e65c57a5
--- /dev/null
+++ b/app/Console/Commands/createUsefulLink.php
@@ -0,0 +1,53 @@
+alert('You can add Icons to your useful links. Go to https://fontawesome.com/v5.15/icons?d=gallery&p=2 and copy an Icon name.');
+
+ $icon = $this->ask('Specify the class(es) of the font-awesome icon you want to use as the icon. (e.x: ad, fa fa-briefcase, fab fa-discord)', '');
+ $title = $this->ask('What do you want the title to be of this message?', 'Default Useful Link Title');
+ $message= $this->ask('Now please type the message you want to show. Tip: You can use HTML to format!');
+ $link = $this->ask('Please fill in a valid Link. Users can click the title to go to the link', 'https://bitsec.dev');
+
+ $usefulLink = UsefulLink::create([
+ 'icon' => $icon,
+ 'title' => $title,
+ 'link' => $link,
+ 'message' => $message
+ ]);
+
+ $this->alert('Command ran successful inserted useful link into database');
+
+ $this->table(['Icon', 'Title', 'Link', 'Message'], [
+ [$icon, $title, $link, $message]
+ ]);
+
+ return 1;
+ }
+}
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 8c042869..2657d60d 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -2,9 +2,11 @@
namespace App\Http\Controllers;
+use App\Models\UsefulLink;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\DB;
class HomeController extends Controller
{
@@ -19,14 +21,17 @@ class HomeController extends Controller
//set cookie as extra layer of defense against users that make multiple accounts
setcookie('4b3403665fea6' , base64_encode(1) , time() + (20 * 365 * 24 * 60 * 60));
- $useage = 0;
+ $usage = 0;
foreach (Auth::user()->Servers as $server){
- $useage += $server->product->price;
+ $usage += $server->product->price;
}
+ $useful_links = DB::table('useful_links')->get();
+
return view('home')->with([
- 'useage' => $useage
+ 'useage' => $usage,
+ 'useful_links' => $useful_links
]);
}
}
diff --git a/app/Models/UsefulLink.php b/app/Models/UsefulLink.php
new file mode 100644
index 00000000..12d422f7
--- /dev/null
+++ b/app/Models/UsefulLink.php
@@ -0,0 +1,20 @@
+id();
+ $table->string('icon')->default('');
+ $table->string('title')->default('Default Title');
+ $table->string('link')->default('https://bitsec.dev');
+ $table->string('message')->default('Default Message');
+ $table->timestamps();
+ });
+
+ \App\Models\UsefulLink::create([
+ 'icon' => 'fas fa-egg',
+ 'title' => 'Pterodactyl Panel',
+ 'link' => env('PTERODACTYL_URL' , 'http://localhost'),
+ 'message' => 'Use your servers on our pterodactyl panel (You can use the same login details)'
+ ]);
+ \App\Models\UsefulLink::create([
+ 'icon' => 'fas fa-database',
+ 'title' => 'phpMyAdmin',
+ 'link' => env('PHPMYADMIN_URL' , 'http://localhost'),
+ 'message' => 'View your database online using phpMyAdmin'
+ ]);
+ \App\Models\UsefulLink::create([
+ 'icon' => 'fab fa-discord',
+ 'title' => 'Discord',
+ 'link' => env('DISCORD_INVITE_URL'),
+ 'message' => 'Need a helping hand? Want to chat? Got any questions? Join our discord!'
+ ]);
+ \App\Models\UsefulLink::create([
+ 'icon' => 'fas fa-link',
+ 'title' => 'Useful Links',
+ 'link' => '_blank',
+ 'message' => 'Want to make your own links that show here? Use the command php artisan create:usefullink
Delete links via database (for now)'
+ ]);
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('useful_links');
+ }
+}
diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php
index 43e786f5..ce1bda01 100644
--- a/resources/views/home.blade.php
+++ b/resources/views/home.blade.php
@@ -81,26 +81,17 @@