commit
ae5049091f
3 changed files with 16 additions and 21 deletions
|
@ -68,8 +68,6 @@ mkdir -p /var/www/dashboard
|
||||||
cd /var/www/dashboard
|
cd /var/www/dashboard
|
||||||
```
|
```
|
||||||
|
|
||||||
TEXT
|
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
git clone https://github.com/ControlPanel-gg/dashboard.git ./
|
git clone https://github.com/ControlPanel-gg/dashboard.git ./
|
||||||
chmod -R 755 storage/* bootstrap/cache/
|
chmod -R 755 storage/* bootstrap/cache/
|
||||||
|
@ -103,7 +101,7 @@ Store it somewhere safe - not just on your server. If you lose it all encrypted
|
||||||
|
|
||||||
### Environment Configuration
|
### Environment Configuration
|
||||||
Simply edit the .env to your needs
|
Simply edit the .env to your needs
|
||||||
Please do not forget to enter the database creds in here or the next step wont work
|
Please **do not** forget to enter the database creds in here or the next step wont work
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
nano .env
|
nano .env
|
||||||
|
@ -119,8 +117,9 @@ php artisan migrate --seed --force
|
||||||
```
|
```
|
||||||
|
|
||||||
### Add The First User
|
### Add The First User
|
||||||
Currenly I haven't made a easy command for this so just enter your databse with phpmyadmin and create a new user with the role 'admin'
|
``` bash
|
||||||
|
php artisan make:user
|
||||||
|
```
|
||||||
|
|
||||||
### Set Permissions
|
### Set Permissions
|
||||||
The last step in the installation process is to set the correct permissions on the Panel files so that the webserver can
|
The last step in the installation process is to set the correct permissions on the Panel files so that the webserver can
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
use App\Classes\Pterodactyl;
|
use App\Classes\Pterodactyl;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
class createUser extends Command
|
class createUser extends Command
|
||||||
|
@ -39,33 +39,29 @@ class createUser extends Command
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|
||||||
$ptero_id = $this->option('ptero_id') ?? $this->ask('Please specify your Pterodactyl ID.');
|
$ptero_id = $this->option('ptero_id') ?? $this->ask('Please specify your Pterodactyl ID.');
|
||||||
|
|
||||||
$password = $this->option('password') ?? $this->ask('Please specify your password.');
|
$password = $this->option('password') ?? $this->ask('Please specify your password.');
|
||||||
|
|
||||||
|
|
||||||
if (strlen($password) < 8) {
|
if (strlen($password) < 8) {
|
||||||
print_r('Your password need to be atleast 8 characters long');
|
print_r('Your password need to be at least 8 characters long');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
|
|
||||||
$response = Pterodactyl::getUser($ptero_id);
|
|
||||||
|
|
||||||
|
$response = Pterodactyl::getUser($ptero_id);
|
||||||
|
|
||||||
if (is_null($response)) {
|
if (is_null($response)) {
|
||||||
print_r('It seems that your Pterodactyl ID isnt correct. Rerun the command and input an correct ID');
|
print_r('It seems that your Pterodactyl ID isnt correct. Rerun the command and input an correct ID');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
|
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'name' => $response['first_name'],
|
'name' => $response['first_name'],
|
||||||
'email' => $response['email'],
|
'email' => $response['email'],
|
||||||
'role' => 'admin',
|
'role' => 'admin',
|
||||||
'password' => Hash::make($password),
|
'password' => Hash::make($password),
|
||||||
'pterodactyl_id' => $response['id']
|
'pterodactyl_id' => $response['id']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -76,6 +72,7 @@ class createUser extends Command
|
||||||
['Ptero-ID', $user->pterodactyl_id],
|
['Ptero-ID', $user->pterodactyl_id],
|
||||||
['Admin', $user->role],
|
['Admin', $user->role],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ class DatabaseSeeder extends Seeder
|
||||||
{
|
{
|
||||||
$this->call([
|
$this->call([
|
||||||
ConfigurationSeeder::class,
|
ConfigurationSeeder::class,
|
||||||
UserSeeder::class,
|
|
||||||
ProductSeeder::class,
|
ProductSeeder::class,
|
||||||
PaypalProductSeeder::class,
|
PaypalProductSeeder::class,
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue