<file_sep><?php

namespace MicroGames\Http\Controllers;

use MicroGames\gameObject;
use MicroGames\gamePages;
use Chumper\Zipper\Facades\Zipper;
use Illuminate\Http\Request;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use ZipArchive;

class CreatorGameController extends Controller
{
    use Sluggable;

    public function create()
    {
        return view('creator.game.create');
    }

    public function createLayout($id)
    {
        return view('creator.game.createLayout', compact('id'));
    }

    public function storeLayout(Request $request)
    {
        $gameId = $request->gameId;
        $game = gamePages::findOrFail($gameId);
        if ($game->user_id != Auth::user()->id) {
            return redirect(route('game'));
        }

        if ($game->gameObject != null) {
            return redirect(route('game'));
        }
        $whatIsRequested = explode(',', $request->totalDivs);
        array_shift($whatIsRequested);
        $testArray = array();
        $i = 0;

        foreach ($whatIsRequested as $element) {
            $i++;
            if (strpos($element, 'title') === 0) {
                $name = 'title'.$i;
                gameObject::create(['game_pages_id' => $gameId, 'order_number' => $i, 'kind' => 'title', 'what' => $request->$name]);
            } elseif (strpos($element, 'file') === 0) {
                $name = 'file'.$i;
                request()->validate([
                    $name => 'required|image|mimes:jpeg,png,jpg,gif,svg',
                ]);
                request()->$name->move(public_path('images/games/page'), $gameId.".".$i.".".request()->$name->getClientOriginalExtension());
                gameObject::create(['game_pages_id' => $gameId, 'order_number' => $i, 'kind' => 'file', 'what' => $gameId.".".$i.".".request()->$name->getClientOriginalExtension()]);
            } elseif (strpos($element, 'text') === 0) {
                $name = 'text'.$i;
                gameObject::create(['game_pages_id' => $gameId, 'order_number' => $i, 'kind' => 'text', 'what' => $request->$name]);
            }
        }

        return redirect(route('gameDetail', [$gameId, 'game']));
    }

    public function sluggable()
    {
        return [
            'slug' => [
                'source' => 'name'
            ]
        ];
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {

        request()->validate([
            'mainPicture' => 'required|image|mimes:jpeg,png,jpg,gif,svg',
            'game' => 'required',
        ]);


        $input = $request->validate([
            'title' => 'required|max:191',
            'selectedTags' => 'max:191',
        ]);


        $game = gamePages::create(['name' => $input['title'], 'user_id' => Auth::user()->id]);

        request()->mainPicture->move(public_path('images/games/main'), $game['id'].".".request()->mainPicture->getClientOriginalExtension());
        request()->game->move(public_path('games'), $game['id'].".".request()->game->getClientOriginalExtension());

        $Path = public_path("games/".$game['id'].".".request()->game->getClientOriginalExtension());

        $za = new ZipArchive();

        $za->open($Path);

        $name =  explode('/', $za->statIndex(0)['name'])[0];

        \Zipper::make($Path)->extractTo('games');

        rename(public_path('games')."/".$name, public_path("games/".$game['id']));

        //tags

        $tags = json_decode($input['selectedTags']);
        $game->tags()->sync($tags);

        return redirect(route('game'));
    }

}
<file_sep><?php

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('users')->insert([
            'id' => 'fa0da26e-278b-4344-9e27-71c19c1b0f0f',
            'name' => 'Joey',
            'email' => '<EMAIL>',
            'password' => <PASSWORD>',
        ]);

        DB::table('model_has_roles')->insert([
            'role_id' => '3',
            'model_type' => 'MicroGames\User',
            'model_id' => 'fa0da26e-278b-4344-9e27-71c19c1b0f0f',
        ]);
    }
}
<file_sep>var first = true;
getGameExp(true);
setInterval(function()
{

    getGameExp();

}, 300000);

function getGameExp(empty = false)
{
    $.ajax({
        method: "GET",
        url: "../../randomNumber",
    })
    .done(function( data ) {
        $.ajax({
            method: "GET",
            url: "../../getExp",
            data: { number: data, empty: empty }
        })
        .done(function ( data )  {
            var newData = JSON.parse(data);
            if (newData.level != undefined) {
                $("#xp").text(newData.currentExp + " | " + newData.neededExp);
                $(".levelTitle").text(newData.level);
                if (first) {
                    first = false;
                    getGameExp();
                }
            }
        });
    });
}
<file_sep>$( document ).ready(function() {

    $("#searchUser").keyup(function() {
        var tagsData = "";
        var name = $("#searchUser").val();
        if (name == "") {
            tagsData = "Type something in to search for a user";
            $("#searchedUsers").html(tagsData);
        } else {
            $.ajax({
                method: "GET",
                url: "../users/"+name,
            })
                .done(function( data ) {
                    if (data == "[]") {
                        tagsData = "We could not find anybody with that name";
                    } else {
                        $.each(jQuery.parseJSON(data), function( index, data ) {
                            tagsData += "<button type='button' class='userButtons' id='user"+data.name+"' onclick='selectUser(\""+data.id+"\", \""+data.name+"\")'>"+data.name+"</button>";
                        });
                    }

                    $("#searchedUsers").html(tagsData);
                });
        }
    });
});

function selectUser(id, name)
{
    $(".userButtons").css('border-color', 'white');
    // this.style('color: blue');
    $("#user_id_receiver").val(id);
    $("#user"+name).css('border-color', 'blue');
}
<file_sep><?php

namespace MicroGames;

use Illuminate\Database\Eloquent\Model;

class Inbox extends Model
{
    protected $fillable = [
        'user_id_receiver',
        'user_id_sender',
        'title',
        'text',
    ];

    public function user()
    {
        return $this->belongsTo('MicroGames\User', 'user_id_sender', 'id');
    }
}
<file_sep><?php

namespace MicroGames\Http\Controllers;

use MicroGames\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;

class MemberProfileController extends Controller
{
    public function index()
    {
        $user = Auth::user();
        return view('member.profile.index', compact('user'));
    }

    public function edit()
    {
        $user = Auth::user();
        return view('member.profile.edit', compact('user'));
    }

    public function patch(Request $request)
    {
        $input = $request->validate([
            'name' => 'required|max:191',
            'first_name' => 'max:191',
            'last_name' => 'max:191',
            'email' => 'email|required|max:191',
        ]);


        $user = User::findOrFail(Auth::user()->id);

        if ($user->password != null) {
            /*
            if (!Hash::check($input['oldPassword'], $user->password)) {
                return $user->password;
//                return redirect(route('memberProfileEditForm'))->withErrors(['msg', 'You need to type the right password in']);;
            }
            */
            if (isset($request['password1'])) {
                if ($request['password1'] == $request['password2']) {
                    $input['password'] = Hash::make($request['password1']);
                } else {
                    return redirect(route('memberProfileEditForm'))->withErrors(['msg', 'Your passwords do not match']);;
                }
            }
        }

        User::findOrFail($user->id)->update($input);

        return redirect(route('memberProfile'));

    }

}
<file_sep><?php

namespace MicroGames\Http\Controllers;

use MicroGames\tags;
use MicroGames\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class AjaxController extends Controller
{
    public function tags($name)
    {
        $tags = tags::where('name', 'LIKE', '%'.$name.'%')->get();
        return json_encode($tags);
    }

    public function tag($id)
    {
        $tag = tags::findOrFail($id);
        return json_encode($tag);
    }

    public function users($name)
    {
        $user = User::where('name', 'LIKE', '%'.$name.'%')->get();
        return json_encode($user);
    }

    public function randomNumber()
    {
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $charactersLength = strlen($characters);
        $randomString = '';
        for ($i = 0; $i < 50; $i++) {
            $randomString .= $characters[rand(0, $charactersLength - 1)];
        }

        session(['randomString' => $randomString]);

        return $randomString;
    }

    public function getExp(Request $request)
    {
        if (Auth::check()) {
            $empty = $request->empty;
            if ($request->number == session('randomString')) {
                if (session('time') == "") {
                    session(['time' => time()]);
                    return 'false';
                } else {
                    if (time() - (int)session('time') >= 300) {
                        session(['time' => time()]);
                        $user = User::findOrFail(Auth::user()->id);
                        $currentExp = $user->exp;
                        $currentLevel = (int)$user->level;
                        $neededExp = 150 * $currentLevel * $currentLevel/3;

                        if ($currentExp >= $neededExp) {
                            $currentLevel++;
                            $currentExp = 0;
                        }

                        $user->update(['exp' => (int)$currentExp+50, 'level' => $currentLevel]);
                        return json_encode(['currentExp' => (int)$currentExp+50 , 'level' => $currentLevel, 'neededExp' => $neededExp]);
                    } else {
                        return 'false';
                    }
                }
            } else {
                return 'false';
            }
        } else {
            return 'false';
        }
    }
}
<file_sep><?php

namespace MicroGames\Http\Controllers;

use MicroGames\tags;
use MicroGames\User;
use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;

class AdminUsersController extends Controller
{
    public function index()
    {
        return view('admin.users.index');
    }

    public function detail($id)
    {
        return view('admin.users.detail');
    }

    public function assignRole(Request $request)
    {
        $user = User::findOrFail($request->user_id);

        switch ($request->role) {
            case 'Member':
                $user->syncRoles('Member');
                break;
            case 'Creator':
                $user->syncRoles('Creator');
                break;
            case 'Admin':
                $user->syncRoles('Admin');
                break;

            default:
                return redirect(route('adminUsersRoles'));
        }
        return redirect(route('adminUsersRoles'));
    }

    public function roles()
    {
        $users = User::paginate(1);
        return view('admin.roles.index', compact('users'));
    }

    public function createTagForm()
    {
        return view('admin.tags.create');
    }

    public function createTag(Request $request)
    {
        Tags::create(['name' => $request->name]);
        return redirect(route('game'));
    }

    //testing remove when done

    public function setAllRoles()
    {
        Role::create(['name' => 'Member']);
        Role::create(['name' => 'Creator']);
        Role::create(['name' => 'Admin']);
    }
}
<file_sep>var bannerHeight
var bannerWidth

$(document).ready(function(){

  window.setInterval(function(){
    bannerHeight = $('.banner').height();
    $('.underImage').css('height', bannerHeight+'px');

    bannerWidth = $('.banner').width();
    $('.underImage').css('width', bannerWidth+'px');
  }, 10);

});
<file_sep><?php

namespace MicroGames;

use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Spatie\Permission\Traits\HasRoles;
use Illuminate\Support\Str;

class User extends Authenticatable
{
    use HasRoles;
    use Notifiable;

    public $incrementing = false;

    protected $guard_name = 'web';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'first_name', 'last_name', 'email', 'password', 'provider_id', 'provider', 'level', 'exp', 'profile_picture',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];

    protected static function boot()
    {
        parent::boot();
        static::creating(function ($post) {
            $post->{$post->getKeyName()} = (string) Str::uuid();
        });
    }
    public function getKeyType()
    {
        return 'id';
    }

    public function gamePages()
    {
        return $this->hasMany('MicroGames\gamePages');
    }

    public function inbox()
    {
        return $this->hasMany('MicroGames\Inbox', 'user_id_receiver');
    }

    public function inboxSender()
    {
        return $this->hasMany('MicroGames\Inbox', 'user_id_sender');
    }

    public function banned()
    {
        return $this->hasMany('MicroGames\Banned');
    }

    public function bannedBy()
    {
        return $this->hasMany('MicroGames\Banned', 'banned_by');
    }

    public function requests()
    {
        return $this->hasMany('MicroGames\Requests');
    }

    public function requestsChecked()
    {
        return $this->hasMany('MicroGames\Requests', 'checked_by');
    }

    public function reactions()
    {
        return $this->hasMany('MicroGames\Reactions');
    }
}
<file_sep><?php

namespace MicroGames\Http\Controllers;

use MicroGames\Inbox;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class MemberInboxController extends Controller
{
    public function index()
    {
        $user = Auth::user();
        $inbox = $user->inbox()->get();
        return view('member.inbox.index', compact('inbox'));
    }

    public function detail($id)
    {
        $message = Inbox::find($id)->where('user_id_receiver', Auth::user()->id)->first();
        return view('member.inbox.detail',compact('message'));
    }

    public function create()
    {
        return view('member.inbox.create');
    }

    public function store(Request $request)
    {
        $input = $request->validate([
            'user_id_receiver' => 'required|max:191',
            'title' => 'required|max:191',
            'text' => 'required',
        ]);
        $input['user_id_sender'] = Auth::user()->id;

        Inbox::create($input);
        return redirect(route('memberInboxIndex'));
    }

    public function createId($id)
    {
        return view('member.inbox.create');
    }

    public function destroy($id)
    {
        Inbox::find($id)->where('user_id_receiver', Auth::user()->id)->first()->delete();
        return redirect(route('game'));
    }
}
<file_sep><?php

namespace MicroGames\Http\Controllers;

use MicroGames\gameObject;
use MicroGames\gamePages;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class MemberGameController extends Controller
{
    public function index()
    {
        $games = gamePages::orderBy('created_at')->get();
        return view('games.index', compact('games'));
    }

    public function search($name)
    {
        $games = gamePages::where('name', 'LIKE', '%'.$name.'%')->get();
            return view('games.index', compact('games'));
    }

    public function searchBar(Request $request)
    {
        return $this->search($request->name);
    }

    public function detail($id, $name)
    {
        $pages = gameObject::where('game_pages_id', $id)->orderBy('order_number', 'asc')->get();
        return view('games.detail', compact('pages', 'id', 'name'));
    }

    public function play($id, $name)
    {
        return redirect('games/'.$id.'/index.html');
//        return view('games.play', compact('id'));
    }
}
<file_sep>$( document ).ready(function() {

    $("#searchTags").keyup(function() {
        var tagsData = "";
        var name = $("#searchTags").val();
        if (name == "") {
            tagsData = "Type something in to search for a tag";
            $("#searchedTags").html(tagsData);
        } else {
            $.ajax({
                method: "GET",
                url: "../tags/"+name,
            })
            .done(function( data ) {
                $.each(jQuery.parseJSON(data), function( index, data ) {
                    tagsData += "<button type='button' onclick='selectTag("+data.id+")'>"+data.name+"</button>";
                });
                $("#searchedTags").html(tagsData);
            });
        }
    });
});

function selectTag(id)
{
    var inside = false;
    var val = $("#selectedTagsHidden").val();
    if (val == "") {
        $("#selectedTagsHidden").val(JSON.stringify([id]));
        inside = true;
    } else {
        var valJson = jQuery.parseJSON(val);
        if (jQuery.inArray(id, valJson) == -1) {
            valJson.push(id);
            $("#selectedTagsHidden").val(JSON.stringify(valJson));
            inside = true;
        }
    }

    if (inside) {
        var selected = $("#selectedTags").html();

        $.ajax({
            method: "GET",
            url: "../tag/"+id,
        })
            .done(function( data ) {
                var newData = jQuery.parseJSON(data);
                $("#selectedTags").html(selected + "<button type='button' id='button"+id+"' onclick='removeTag("+id+")'>"+newData.name+"</button>");
            });
    }
    inside = false;
}

function removeTag(id)
{
    var val = $("#selectedTagsHidden").val();
    var valJson = jQuery.parseJSON(val);

    console.log(valJson);

    var index = valJson.indexOf(id);
    if (index > -1) {
        valJson.splice(index, 1);
    }
    console.log(valJson);

    $("#selectedTagsHidden").val(JSON.stringify(valJson));

    $("#button"+id).remove();
}
<file_sep><?php

namespace MicroGames;

use Illuminate\Database\Eloquent\Model;

class reactions extends Model
{
    protected $fillable = [
        'game_id',
        'user_id',
        'rating',
        'title',
        'text',
    ];
    public function user()
    {
        return $this->belongsTo('MicroGames\User');
    }

    public function gamePage()
    {
        return $this->belongsTo('MicroGames\GamePages', 'id', 'game_id');
    }
}
<file_sep><?php

namespace MicroGames;

use Illuminate\Database\Eloquent\Model;

class Banned extends Model
{
    protected $fillable = [
        'user_id',
        'reason',
        'permanent',
        'until',
        'banned_by',
    ];
}
<file_sep>var select = false;
var idSelect;
var numberOfElements = 0;

function selected(id) {
 if (select) {
   if (id == idSelect) {
     select = false;
     $('#'+idSelect).css('background-color','white');
     $('#' + idSelect + ' > p:first').css('color','#3CB46D');
     idSelect = '';
   } else {
     $('#'+id).css('background-color','#3CB46D');
     $('#' + id + ' > p:first').css('color','white');
     $('#'+idSelect).css('background-color','white');
     $('#' + idSelect + ' > p:first').css('color','#3CB46D');
     idSelect = id;
   }
 } else {
   select = true;
   $('#'+id).css('background-color','#3CB46D');
   $('#' + id + ' > p:first').css('color','white');
   idSelect = id;
 }
 console.log(select);
}

function createDiv() {
    if (select){
      numberOfElements++;

      var heightClass = $(".height").html();

      var addClass = '';
      switch (idSelect) {
        case 1:
            addClass = "<div>"+
            "<textarea name='text" + numberOfElements + "' class='form-control designPage' placeholder='Typ your text here...'></textarea>"+
            "</div><hr />";
            $("#totalDivs").val($("#totalDivs").val()+',text'+numberOfElements);
            break;
        case 2:
            addClass = "<div>"+
            "<input type='text' name='title" + numberOfElements + "' class='form-control designPage' placeholder='Typ your title here...'>"+
            "</div><hr />";
            $("#totalDivs").val($("#totalDivs").val()+',title'+numberOfElements);
            break;
        case 3:
            addClass = "<div class='custom-file'>"+
            "<input type='file' class='custom-file-input designPage' id='customFile' name='file" + numberOfElements + "'" + numberOfElements + ">"+
            "<label class='custom-file-label' for='customFile'>Choose file</label>"+
            "</div><hr />";
            $("#totalDivs").val($("#totalDivs").val()+',file'+numberOfElements);
            break;
      }

        $('#exampleModal').modal('hide');
        select = false;
        idSelect = false;
        $('.selectors').css('background-color','white');
        $('.elementText').css('color','#3CB46D');
        $("#createDivs").append(addClass);
    }
}
<file_sep><?php

namespace MicroGames\Http\Controllers;

use Illuminate\Http\Request;

class MemberUsersController extends Controller
{
    public function index()
    {
        return view('member.users.index');
    }
}
<file_sep><?php

namespace MicroGames;

use Illuminate\Database\Eloquent\Model;

class requests extends Model
{
    protected $fillable = [
        'user_id',
        'kind',
        'game_id',
        'accepted',
        'checked_by',
        'checked_text',
    ];

    public function game_pages()
    {
        return $this->belongsTo('MicroGames\GamePages');
    }

}
<file_sep>This is a project we created in 3 days.
Creators of the website:
Back-end: Joey
Front-end: Bas
<file_sep><?php

namespace MicroGames;

use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;

class GamePages extends Model
{
    use Sluggable;

    public $incrementing = false;

    protected $fillable = [
        'id',
        'name',
        'user_id',
    ];

    protected static function boot()
    {
        parent::boot();

        static::creating(function ($game) {
            $game->{$game->getKeyName()} = (string) Str::uuid();
        });
    }

    /**
     * Return the sluggable configuration array for this model.
     *
     * @return array
     */
    public function sluggable()
    {
        return [
            'slug' => [
                'source' => 'name'
            ]
        ];
    }

    public function getKeyName()
    {
        return 'id';
    }

    public function gameObject()
    {
        return $this->hasOne('MicroGames\GameObject', 'game_pages_id');
    }

    public function requests()
    {
        return $this->hasOne('MicroGames\Requests');
    }

    public function reactions()
    {
        return $this->hasMany('MicroGames\Reactions', 'game_id');
    }

    public function tags()
    {
        return $this->belongsToMany('MicroGames\Tags');
    }
}
<file_sep><?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Auth::routes();

Route::get('/', 'MemberGameController@index')->name('game');

Route::group(['middleware' => ['role:Member|Creator|Admin']], function () {
    //inbox
    Route::get('/inbox', 'MemberInboxController@index')->name('memberInboxIndex');
    Route::delete('/inbox/{id}', 'MemberInboxController@destroy')->name('memberInboxDestroy');
    Route::get('/inbox/create', 'MemberInboxController@create')->name('memberInboxCreateForm');
    Route::post('/inbox/create', 'MemberInboxController@store')->name('memberInboxCreate');
    Route::get('/inbox/create/{id}', 'MemberInboxController@createId')->name('memberInboxCreateWithId');
    Route::get('/inbox/{id}', 'MemberInboxController@detail')->name('memberInboxDetail');

    //profile
    Route::get('/profile', 'MemberProfileController@index')->name('memberProfile');
    Route::get('/profile/edit', 'MemberProfileController@edit')->name('memberProfileEditForm');
    Route::patch('/profile/edit', 'MemberProfileController@patch')->name('memberProfileEdit');

    //users
    Route::get('/users', 'MemberUsersController@index')->name('memberUsers');
});

Route::group(['middleware' => ['role:Creator|Admin']], function () {
    //game
    Route::get('/game/create', 'CreatorGameController@create')->name('creatorGameCreate');
    Route::post('/game/create', 'CreatorGameController@store')->name('creatorGameCreatePost');
    Route::get('/gameLayout/{id}/{name}', 'CreatorGameController@createLayout')->name('creatorGameLayout');
    Route::post('/game/createLayout', 'CreatorGameController@storeLayout')->name('creatorGameCreatePostLayout');
});

Route::group(['middleware' => ['role:Admin']], function () {
    //admin users
    Route::get('/admin/users/roles', 'AdminUsersController@roles')->name('adminUsersRoles');
    Route::post('/admin/users/roles/assignRole', 'AdminUsersController@assignRole')->name('adminUsersRolesAssign');
    Route::get('/admin/tags/create', 'AdminUsersController@createTagForm')->name('adminTagCreatForm');
    Route::post('/admin/tags/create', 'AdminUsersController@createTag')->name('adminTagCreat');
});

//games
Route::get('/searchBar', 'MemberGameController@searchBar')->name('gameDetailSearchBar');

Route::get('/game/{name}', 'MemberGameController@search')->name('gameDetailName');
Route::get('/game/{id}/{name}', 'MemberGameController@detail')->name('gameDetail');
Route::get('/play/{id}/{name}', 'MemberGameController@play')->name('gamePlay');

//socialite

Route::get('login/{service}',
    'Auth\LoginController@redirectToProvider')->name('loginService');

Route::get('login/{service}/callback',
    'Auth\LoginController@handleProviderCallback');

//js loaders

Route::get('tags/{name}', 'AjaxController@tags')->name('AjaxTags');
Route::get('tag/{name}', 'AjaxController@tag')->name('AjaxTag');
Route::get('users/{name}', 'AjaxController@users')->name('AjaxTag');
Route::get('getExp', 'AjaxController@getExp')->name('AjaxGetExp');
Route::get('randomNumber', 'AjaxController@randomNumber')->name('AjaxRandomNumber');

//test need to remove

Route::get('test/setAllRoles', 'AdminUsersController@setAllRoles');
//Route::get('test/assignRole/{userId}/{ruleName}', 'AdminUsersController@assignRole');
<file_sep><?php

namespace MicroGames;

use Illuminate\Database\Eloquent\Model;

class GameObject extends Model
{
    protected $fillable = [
        'game_pages_id',
        'order_number',
        'kind',
        'what',
    ];

    public function gamePages()
    {
        return $this->belongsTo('MicroGames\gamePages', 'game_pages_id', 'id');
    }
}
