An open API service indexing awesome lists of open source software.

https://github.com/truemedia/devicecrafting

An online robot battling game built in Laravel 5.4, PHP 7, and VueJS
https://github.com/truemedia/devicecrafting

Last synced: 3 months ago
JSON representation

An online robot battling game built in Laravel 5.4, PHP 7, and VueJS

Awesome Lists containing this project

README

        

# Device Crafting
## An online robot battling game built in Laravel 5.4, PHP 7, and VueJS

### Prerequisites
Before installing this game, you will need the following software dependencies pre-installed:

- [Virtualbox](https://www.virtualbox.org/wiki/Downloads)
- [Vagrant >= 1.5](https://www.vagrantup.com/downloads.html)
- [Homestead vagrant box >= 2.0](https://laravel.com/docs/5.4/homestead)
- [Laravel >= 5.4 instance](https://laravel.com/docs/5.4/installation) (web.site used as an example instance)

Once these have been setup on your machine, you will be able to install this game via the instructions below

### Installation
Add the following code to the `require` section of your composer.json file inside the root directory of your Laravel project:

"wadepenistone/devicecrafting": "dev-master"

Inside the same also add the following code to the repositories section (create repositories section if it does not exist):

{
"type":"vcs",
"url": "[email protected]:Truemedia/device-crafting.git"
}

After than ssh into your vagrant box and run `composer update` followed by `composer dump-autoload -o` in the root folder of your project.

Now you will need to include the service provider for this package inside the app/config.php file of your Laravel instance. Find the providers section of this file and add the items following to the end of the array:

ProAI\Handlebars\HandlebarsServiceProvider::class,
Wadepenistone\Devicecrafting\DevicecraftingServiceProvider::class,

With the providers set you will now need to publish files for this package that will be copied from the package into the folders of the main application.
To do this simply run `php artisan vendor:publish --provider="Wadepenistone\Devicecrafting\DevicecraftingServiceProvider"`

Now you need to alter app/Providers/RouteServiceProvider.php and set the variable `protected $namespace` to `''` (blank). This is so that name-spacing can be set absolutely in routes.

Now in order to have users that can login/register on the site you must make some additional changes.
First run the following commands:

php artisan make:auth
php artisan migrate

This will create all the resources and database tables needed for the application to run.

Also open app/Http/Controllers/Auth/LoginController.php and app/Http/Controllers/Auth/RegisterController.php and change the following line from `/home` to `/my-account`:

protected $redirectTo = '/home';

protected $redirectTo = '/my-account';

Now finally open routes/web.php and make sure to swap the contents of the file with the following:

Route::group(['namespace' => 'App\Http\Controllers'], function() {
Auth::routes();
});

Once this is done you should now be able to use the full extend of the application

### Running
To start the application with sample data generated by the system, simply run the following command in the root directory of your project:

php artisan db:seed --class=RobotsTableSeeder
php artisan db:seed --class=BattlesTableSeeder

### Development
For developing this package, you will need to setup composer to prefer source for this package, so that a git repository will appear in the vendor folder instead of just the contents of the package.

To do this run `composer update wadepenistone/devicecrafting --prefer-source`

### Testing
No testing facilities available at this time (will eventually implement Behat, PHPUnit, and Mocha)