mirror of
https://github.com/exane/not-gwent-online
synced 2025-08-03 12:53:28 +00:00
assets
client
new_public
public
server
site
client
public
server
app
Console
Events
Exceptions
Http
Controllers
Middleware
Requests
Kernel.php
routes.php
Jobs
Listeners
Providers
User.php
bootstrap
config
database
storage
tests
.env.example
artisan
composer.json
phpspec.yml
phpunit.xml
server.php
test
.gitignore
Config.example..js
gulpfile.js
package.json
44 lines
842 B
PHP
Executable File
44 lines
842 B
PHP
Executable File
<?php
|
|
|
|
// todo: move to controllers
|
|
use Gwent\User;
|
|
use Illuminate\Support\Facades\Request;
|
|
|
|
Route::group(['prefix' => 'api'], function() {
|
|
|
|
post('/register', function() {
|
|
$user = new User();
|
|
$user->username = Request::input('username');
|
|
$user->email = Request::input('email');
|
|
$user->password = bcrypt(Request::input('password'));
|
|
$user->save();
|
|
|
|
Auth::login($user);
|
|
});
|
|
|
|
});
|
|
|
|
get('/lobby', function() {
|
|
return innerView();
|
|
});
|
|
|
|
get('/deck-builder', function() {
|
|
return innerView();
|
|
});
|
|
|
|
get('/highscore', function() {
|
|
return innerView();
|
|
});
|
|
|
|
get('/', function() {
|
|
if(Auth::check()) {
|
|
return redirect('/lobby');
|
|
}
|
|
|
|
return view('app')->withSection('landing');
|
|
});
|
|
|
|
function innerView()
|
|
{
|
|
return view('app')->withSection('inner');
|
|
} |