diff --git a/.env.example b/.env.example index 5cf366d01..26681c916 100644 --- a/.env.example +++ b/.env.example @@ -23,5 +23,3 @@ MAIL_FROM=you@example.com API_PREFIX=api API_VERSION=v1 API_DEBUG=false - -APP_VERSION=0.1.0-beta diff --git a/app/Console/Commands/ShowVersion.php b/app/Console/Commands/ShowVersion.php new file mode 100644 index 000000000..0dcce04a1 --- /dev/null +++ b/app/Console/Commands/ShowVersion.php @@ -0,0 +1,63 @@ + + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace Pterodactyl\Console\Commands; + +use Illuminate\Console\Command; + +class ShowVersion extends Command +{ + /** + * The name and signature of the console command. + * + * @var string + */ + protected $signature = 'pterodactyl:version'; + + /** + * The console command description. + * + * @var string + */ + protected $description = 'Display current panel version.'; + + /** + * Create a new command instance. + * + * @return void + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + $this->info('You are running Pterodactyl Panel ' . config('app.version')); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 73478a6da..4afb6007d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -15,6 +15,7 @@ class Kernel extends ConsoleKernel protected $commands = [ \Pterodactyl\Console\Commands\Inspire::class, \Pterodactyl\Console\Commands\MakeUser::class, + \Pterodactyl\Console\Commands\ShowVersion::class, ]; /** diff --git a/config/app.php b/config/app.php index 36bc1a199..314d60fd2 100644 --- a/config/app.php +++ b/config/app.php @@ -4,6 +4,8 @@ return [ 'env' => env('APP_ENV', 'production'), + 'version' => env('APP_VERSION', 'v0.1.1-beta'), + /* |-------------------------------------------------------------------------- | Application Debug Mode diff --git a/resources/views/admin/index.blade.php b/resources/views/admin/index.blade.php index 1e3aa6f92..27e8d52e9 100644 --- a/resources/views/admin/index.blade.php +++ b/resources/views/admin/index.blade.php @@ -30,7 +30,7 @@
Welcome to the most advanced, lightweight, and user-friendly open source game server control panel.
-You are running version {{ env('APP_VERSION', 'unknown') }}
.
You are running version {{ config('app.version') }}
.