Skip to content

Instantly share code, notes, and snippets.

View acacha's full-sized avatar

Sergi Tur Badenas acacha

View GitHub Profile
var level1 = {
preload: function() {
console.log('PRELOAD')
game.load.image('wall','assets/wall.png')
game.load.image('ground','assets/ground.png')
game.load.spritesheet('player','assets/player.png', 28, 22)
},
var level1 = {
preload: function() {
console.log('PRELOAD')
game.load.image('wall','assets/wall.png')
game.load.image('ground','assets/ground.png')
game.load.spritesheet('player','assets/player.png', 28, 22)
},
var level1 = {
preload: function() {
console.log('PRELOAD')
game.load.image('wall','assets/wall.png')
game.load.image('ground','assets/ground.png')
},
create: function() {
console.log('create')
let laravelHeader = document.head.querySelector('meta[name="Laravel"]');
window.Laravel = null
if (laravelHeader) if (laravelHeader.content) window.Laravel = JSON.parse(laravelHeader.content);
<meta name="Laravel" content="{{ json_encode([ 'app' => config('app')]) }}">
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
import * as mutations from '../../mutation-types'
import * as actions from '../../action-types'
import users from '../../../api/users'
export default {
[ actions.LOGGED_USER ] (context) {
return new Promise((resolve, reject) => {
users.fetch().then(response => {
context.commit(mutations.LOGGED_USER, response.data)
resolve(response)
// USERS MODULE
export const LOGGED_USER = 'LOGGED_USER'
@acacha
acacha / LoggedUserControllerTest.php
Created April 17, 2018 10:08
LoggedUserControllerTest
<?php
namespace Tests\Feature;
use App\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
/**
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Passport\HasApiTokens;
class User extends Authenticatable
{