Skip to content

Commit

Permalink
Add basic Artisan Commands
Browse files Browse the repository at this point in the history
More to come!
  • Loading branch information
notAreYouScared committed Aug 18, 2024
1 parent ee3d872 commit f27650d
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 2 deletions.
238 changes: 238 additions & 0 deletions docs/panel/advanced/artisan.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
# Artisan Commands
This is very much a WIP! Many Many commands, Layout might change.

Updated: 8/18/2024 ~notCharles
## User Commands
### Create a User

Creates a user on the system via the CLI.
```sh
php artisan p:user:make [options]
```

```sh
Options:
--email[=EMAIL]
--username[=USERNAME]
--password[=PASSWORD]
--admin[=ADMIN]
--no-password
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```

### Delete a User

Deletes a user from the Panel if no servers are attached to their account.
```sh
php artisan p:user:delete [options]
```

```sh
Options:
--user[=USER]
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```

### Disable 2fa for a single User

Disable two-factor authentication for a specific user in the Panel.
```sh
php artisan p:user:disable2fa [options]
```

```sh
Options:
--email[=EMAIL] The email of the user to disable 2-Factor for.
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question

```

## Editing the Environment

### Editing Cache
```sh
php artisan p:environment:cache [options]
```

```sh
Options:
--driver[=DRIVER] The cache driver backend to use.
--redis-host[=REDIS-HOST] Redis host to use for connections.
--redis-user[=REDIS-USER] User used to connect to redis.
--redis-pass[=REDIS-PASS] Password used to connect to redis.
--redis-port[=REDIS-PORT] Port to connect to redis over.
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```

### Editing Database
```sh
php artisan p:environment:database [options]
```

```sh
Options:
--driver[=DRIVER] The database driver backend to use.
--database[=DATABASE] The database to use.
--host[=HOST] The connection address for the MySQL/ MariaDB server.
--port[=PORT] The connection port for the MySQL/ MariaDB server.
--username[=USERNAME] Username to use when connecting to the MySQL/ MariaDB server.
--password[=PASSWORD] Password to use for the MySQL/ MariaDB database.
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```
### Editing Mail
```sh
php artisan p:environment:mail [options]
```

```sh
Options:
--driver[=DRIVER] The mail driver to use.
--email[=EMAIL] Email address that messages from the Panel will originate from.
--from[=FROM] The name emails from the Panel will appear to be from.
--encryption[=ENCRYPTION]
--host[=HOST]
--port[=PORT]
--endpoint[=ENDPOINT]
--username[=USERNAME]
--password[=PASSWORD]
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```
### Editing Queue
```sh
php artisan p:environment:queue [options]
```

```sh
Options:
--driver[=DRIVER] The queue driver backend to use.
--redis-host[=REDIS-HOST] Redis host to use for connections.
--redis-user[=REDIS-USER] User used to connect to redis.
--redis-pass[=REDIS-PASS] Password used to connect to redis.
--redis-port[=REDIS-PORT] Port to connect to redis over.
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```
### Editing Session
```sh
php artisan p:environment:session [options]
```

```sh
Options:
--driver[=DRIVER] The queue driver backend to use.
--redis-host[=REDIS-HOST] Redis host to use for connections.
--redis-user[=REDIS-USER] User used to connect to redis.
--redis-pass[=REDIS-PASS] Password used to connect to redis.
--redis-port[=REDIS-PORT] Port to connect to redis over.
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```
### Editing Setup
```sh
php artisan p:environment:setup [options]
```

```sh
Options:
--url[=URL] The URL that this Panel is running on.
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```

## Migrations
### Migration Command
```sh
php artisan migrate [options]
```

```sh
Options:
--database[=DATABASE] The database connection to use
--force Force the operation to run when in production
--path[=PATH] The path(s) to the migrations files to be executed (multiple values allowed)
--realpath Indicate any provided migration file paths are pre-resolved absolute paths
--schema-path[=SCHEMA-PATH] The path to a schema dump file
--pretend Dump the SQL queries that would be run
--seed Indicates if the seed task should be re-run
--seeder[=SEEDER] The class name of the root seeder
--step Force the migrations to be run so they can be rolled back individually
--graceful Return a successful exit code even if an error occurs
--isolated[=ISOLATED] Do not run the command if another instance of the command is already running [default: false]
-q, --quiet Do not output any message
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```
### Running Migations
```sh
php artisan migrate
```
### Rollback previous Migration
```sh
php artisan migrate:rollback [options]
```
```sh
Options:
--database[=DATABASE] The database connection to use
--force Force the operation to run when in production
--path[=PATH] The path(s) to the migrations files to be executed (multiple values allowed)
--realpath Indicate any provided migration file paths are pre-resolved absolute paths
--pretend Dump the SQL queries that would be run
--step[=STEP] The number of migrations to be reverted
--batch=BATCH The batch of migrations (identified by their batch number) to be reverted
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```
### Check Migration Status
```sh
php artisan migrate:status [options]
```
```sh
Options:
--database[=DATABASE] The database connection to use
--pending[=PENDING] Only list pending migrations [default: false]
--path[=PATH] The path(s) to the migrations files to use (multiple values allowed)
--realpath Indicate any provided migration file paths are pre-resolved absolute paths
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
```
Providing no extra options, `php artisan migrate:status`, You should see an output similar to the below
```sh title='Migration Status Output'
Migration name .............................................................................. Batch / Status
2016_01_23_195641_add_allocations_table ............................................................ [1] Ran
2016_01_23_195851_add_api_keys ..................................................................... [1] Ran
...
...
2024_07_12_095213_fix_missing_sqlite_foreign_keys .................................................. [1] Ran
2024_08_13_171337_fix_allocation_server_foreign_key ................................................ [2] Ran
```
If any show `PENDING` or `FAILED`. Open a support thread on our discord for further assistance.
## Clearing Cache
The below commands are helpful if you need to clear the config or application cache.
```sh
php artisan cache:clear # Clears application cache
```
```sh
php artisan config:clear # Clears configuration cache
```
2 changes: 1 addition & 1 deletion docs/wings/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Updating Wings is a painless process and should take less than a minute to compl

| Panel Version | Wings Version | Supported |
|:-------------:|:-------------:|:---------:|
|3.x | 3.x | ✅︎ |
|1.0.0+ | 1.0.0+ | ✅︎ |

## Download Update

Expand Down
3 changes: 2 additions & 1 deletion sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const sidebars: SidebarsConfig = {
label: 'Advanced',
items: [
'panel/advanced/redis',
'panel/advanced/mysql'
'panel/advanced/mysql',
'panel/advanced/artisan',
]
}
],
Expand Down

0 comments on commit f27650d

Please sign in to comment.