insert imgs.

master
Paulo Vieira 2018-01-11 17:39:38 +00:00
parent fd9a6b7435
commit df923c49a3
56 changed files with 45 additions and 31 deletions

View File

@ -1,17 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Department extends Model
{
protected $fillable = [
'name',
];
public function users()
{
return $this->hasMany(User::class);
}
}

View File

@ -50,7 +50,8 @@ class RegisterController extends Controller
return Validator::make($data, [
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed'
'password' => 'required|string|min:6|confirmed',
'username' => 'required|string|email|max:255|unique:users'
]);
}
@ -65,7 +66,8 @@ class RegisterController extends Controller
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password'])
'password' => bcrypt($data['password']),
'username' => $data['email']
]);
}
}

View File

@ -7,7 +7,7 @@ use Illuminate\Http\Request;
define('YOUR_SERVER_URL', 'http://badmemory.test');
// Check "oauth_clients" table for next 2 values:
define('CLIENT_ID', '2');
define('CLIENT_SECRET','KN0kCLNhCPFfjz8PTLqnaGU4Kn6qzu3ToRtcHIk5');
define('CLIENT_SECRET','aSS3IeN5y7kSasdsArpbWpMLIdk1FMnEfYph2oAR');
class LoginControllerAPI extends Controller
{

View File

@ -36,6 +36,7 @@ class UserControllerAPI extends Controller
'password' => 'min:3'
]);
$user = new User();
$user->username = $request->email;
$user->fill($request->all());
$user->password = Hash::make($user->password);
$user->save();
@ -50,6 +51,7 @@ class UserControllerAPI extends Controller
'password' => 'min:3'
]);
$user = User::findOrFail($id);
$user->username = $request->email;
$user->update($request->all());
return new UserResource($user);
}

View File

@ -18,7 +18,7 @@ class User extends Authenticatable
protected $fillable = [
'name',
'email',
'age',
'username',
];
/**

View File

@ -15,6 +15,7 @@ class InitialMigrations extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->string('username')->unique();
$table->increments('id');
$table->string('name');
$table->string('email')->unique();

View File

@ -24,9 +24,11 @@ class UsersTableSeeder extends Seeder
static $password;
$createdAt = Carbon\Carbon::now()->subDays(30);
$updatedAt = $faker->dateTimeBetween($createdAt);
$emailUsername = $faker->unique()->safeEmail;
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email' => $emailUsername,
'username' => $emailUsername,
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
'created_at' => $createdAt,

BIN
laravel_server/public/img/.DS_Store vendored Normal file

Binary file not shown.

BIN
laravel_server/public/img/0.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
laravel_server/public/img/1.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
laravel_server/public/img/10.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
laravel_server/public/img/11.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
laravel_server/public/img/12.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
laravel_server/public/img/13.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
laravel_server/public/img/14.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
laravel_server/public/img/15.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
laravel_server/public/img/16.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
laravel_server/public/img/17.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
laravel_server/public/img/18.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
laravel_server/public/img/19.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
laravel_server/public/img/2.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
laravel_server/public/img/20.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
laravel_server/public/img/21.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
laravel_server/public/img/22.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
laravel_server/public/img/23.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
laravel_server/public/img/24.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
laravel_server/public/img/25.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
laravel_server/public/img/26.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
laravel_server/public/img/27.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
laravel_server/public/img/28.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
laravel_server/public/img/29.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
laravel_server/public/img/3.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
laravel_server/public/img/30.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
laravel_server/public/img/31.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
laravel_server/public/img/32.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
laravel_server/public/img/33.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
laravel_server/public/img/34.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
laravel_server/public/img/35.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
laravel_server/public/img/36.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
laravel_server/public/img/37.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
laravel_server/public/img/38.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
laravel_server/public/img/39.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
laravel_server/public/img/4.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
laravel_server/public/img/40.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
laravel_server/public/img/5.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
laravel_server/public/img/6.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
laravel_server/public/img/7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
laravel_server/public/img/8.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
laravel_server/public/img/9.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

View File

@ -46787,8 +46787,12 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
register: function register() {
this.$router.push('/register');
}
}
},
computed: function computed() {
this.$forceUpdate();
}
});
/***/ }),
@ -46995,7 +46999,7 @@ exports = module.exports = __webpack_require__(2)(false);
// module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
// exports
@ -47033,6 +47037,8 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
message: function message() {
return "Sure you want logout?";
}
//this.$forceUpdate();
},
methods: {
logout: function logout() {
@ -47223,7 +47229,8 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
axios.post('/api/register', {
email: this.user.email,
password: this.user.password,
name: this.user.name
name: this.user.name,
username: this.user.email
}).then(function (response) {
console.log(response);
_this.$router.push('/');
@ -47234,8 +47241,11 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
console.log('Login Error: ' + registerError);
});
}
}
},
computed: function computed() {
this.$forceUpdate();
}
});
/***/ }),

View File

@ -64,6 +64,12 @@ export default {
this.$router.push('/register');
}
},
computed() {
this.$forceUpdate();
}

View File

@ -24,6 +24,7 @@ export default {
message(){
return "Sure you want logout?";
}
//this.$forceUpdate();
},
methods: {
logout() {

View File

@ -52,7 +52,8 @@ export default {
axios.post('/api/register', {
email : this.user.email,
password : this.user.password,
name : this.user.name
name : this.user.name,
username : this.user.email
}).then(response => {
console.log(response);
this.$router.push('/');
@ -65,6 +66,11 @@ export default {
});
}
},
computed(){
this.$forceUpdate();
}

View File

@ -4,12 +4,13 @@
@section('content')
<router-link to="/users">Users</router-link> -
@if(!Auth::user())
<router-link to="/login">Login</router-link> -
<router-link to="/register">Register</router-link> -
<router-link to="/logout">Logout</router-link> -
<router-link to="/register">Register</router-link> -
@else
<router-link to="/logout">Logout</router-link> -
@endif
<router-link to="/singletictactoe">SinglePlayer TicTacToe</router-link> -
<router-link to="/multitictactoe">Multiplayer TicTacToe</router-link>