dan-powell / jellies
为Laravel 5设计的极好的MMO游戏
v0.2.0
2017-05-13 20:51 UTC
Requires
- edvinaskrucas/notification: ^5.2
- fzaninotto/faker: ^1.6
- laravel/framework: 5.4.*
- laravelcollective/html: ^5.4
- nubs/random-name-generator: ^2.1
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-20 23:44:04 UTC
README
基于浏览器的MMO游戏,有果冻和其他内容。
工作进行中
此软件处于预alpha阶段,请不要现在使用它...
安装
使用composer安装
composer require dan-powell/jellies
将服务提供者添加到config/app.php
// Jellies Service Provider
DanPowell\Jellies\JelliesServiceProvider::class,
// Third Party
Collective\Html\HtmlServiceProvider::class,
Krucas\Notification\NotificationServiceProvider::class,
将别名添加到config/app.php
// Jellies
// Third Party
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Notification' => Krucas\Notification\Facades\Notification::class,
将中间件添加到app/Http/Kernel.php
protected $middlewareGroups = [
'web' => [
...
\Illuminate\Session\Middleware\StartSession::class,
\Krucas\Notification\Middleware\NotificationMiddleware::class,
Kernel中间件数组(必须在'Illuminate\Session\Middleware\StartSession'中间件之后放置)
发布资源
php artisan vendor:publish --tag='database'
运行迁移
php artisan migrate
在config/auth.php
中更改默认认证模型
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => DanPowell\Jellies\Models\User::class,
],
将命令类添加到app/Console/Kernel.php
use DanPowell\Jellies\Console\Commands\Incursion\IncursionProcessEncounters;
use DanPowell\Jellies\Console\Commands\User\UserAddAction;
use DanPowell\Jellies\Console\Commands\User\UserAttack;
class Kernel extends ConsoleKernel
{
protected $commands = [
IncursionProcessEncounters::class,
UserAddAction::class,
UserAttack::class
];
将定时任务添加到app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
$schedule->command('incursion:encounters --queue')->everyFiveMinutes();
$schedule->command('user:actions --queue')->hourly();
}
更新
发布资源
php artisan vendor:publish --tag='database' --force
迁移
php artisan migrate
播种
发布数据库
php artisan vendor:publish --tag='database' --force
将播种器添加到database/seeds/DatabaseSeeder.php
$this->call('JelliesSeeder');
播种
composer dump-autoload
php artisan db:seed
测试
发布测试
php artisan vendor:publish --tag='tests' --force
将测试数据库添加到config/database.php
'testing' => [
...
'database' => 'testing',
...
],
将模块添加到test/functional.suite.yml
modules:
enabled:
- Laravel5:
environment_file: .env.testing
创建.env.testing
APP_ENV=testing
APP_DEBUG=true
APP_KEY=
BASE_URL=
DB_HOST=localhost
DB_DATABASE=testing
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
迁移
php artisan migrate --database=testing
运行测试
php ./vendor/bin/codecept run