Added HTML Helpers from Laravelcollective

This commit is contained in:
Torsten 2017-06-21 17:12:07 +02:00
parent 0736ecf29f
commit b5c1f40a45
31 changed files with 614 additions and 220 deletions

View file

@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class Game extends Model
{
//
protected $fillable = [
'id','round_id','team1','team2','score1','score2','kickoff'
];
}

View file

@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class GameController extends Controller
{
//
}

View file

@ -0,0 +1,43 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Game;
use Carbon\Carbon;
class GamesController extends Controller
{
public function edit($game_id) {
$game=Game::where('id',$game_id)->first();
//$testdate=str_replace(' UTC ','T',date('Y-m-d h:m'));
return view('games.edit',compact('game'));
}
public function store() {
// Validate form
$this->validate(request(), [
'id' => 'required',
'team1' => 'required',
'team2' => 'required',
'score1' => 'required',
'score2' => 'required',
'kickoff' => 'required'
]);
// Fetch, modify, save game
$game = Game::where('id', request('id'))->first(); // Only for editing existing. New games get created in RoundsController.
$game->team1 = request('team1');
$game->team2 = request('team2');
$game->score1= request('score1');
$game->score2= request('score2');
$game->kickoff=request('kickoff');
$game->save();
// Redirect to the Rounds Index
return redirect('/rounds');
}
}

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Season;
use App\Round;
use App\Game;
use DB;
class RoundsController extends Controller
@ -25,4 +26,96 @@ class RoundsController extends Controller
//return view('rounds.index');
//return view ('welcome');
}
public function create() {
$currentSeason = Season::getCurrent();
if ($currentSeason) {
return view('rounds.create', compact('currentSeason'));
}
redirect()->home()->withErrors('Es muss zuerst eine Saison angelegt werden');
}
public function store() {
// Validate form
$this->validate(request(), [
'name' => 'required',
'game1_team1' => 'required',
'game1_team2' => 'required',
'game1_kickoff' => 'required',
'game2_team1' => 'required',
'game2_team2' => 'required',
'game2_kickoff' => 'required',
'game3_team1' => 'required',
'game3_team2' => 'required',
'game3_kickoff' => 'required',
'game4_team1' => 'required',
'game4_team2' => 'required',
'game4_kickoff' => 'required'
]);
$seasonId = Season::getCurrent()->id;
$round = Round::create([
'name' => request('name'),
'season_id' => $seasonId
]);
$round->save();
$round_id = $round->id;
$game1 = Game::create([
'round_id' => $round_id,
'team1' => request('game1_team1'),
'team2' => request('game1_team2'),
'kickoff' => request('game1_kickoff')
]);
$game2 = Game::create([
'round_id' => $round_id,
'team1' => request('game2_team1'),
'team2' => request('game2_team2'),
'kickoff' => request('game2_kickoff')
]);
$game3 = Game::create([
'round_id' => $round_id,
'team1' => request('game3_team1'),
'team2' => request('game3_team2'),
'kickoff' => request('game3_kickoff')
]);
$game4 = Game::create([
'round_id' => $round_id,
'team1' => request('game4_team1'),
'team2' => request('game4_team2'),
'kickoff' => request('game4_kickoff')
]);
// Sign them in
// Redirect to the home page
return redirect()->home();
}
public function editname($round_id)
{
$round = Round::where('id', $round_id)->first();
return view('rounds.editname', compact('round'));
}
public function storename()
{
// Validate form
$this->validate(request(), [
'round_id' => 'required',
'name' => 'required'
]);
$round = Round::where('id', request('round_id'))->first();
$round->name = request('name');
$round->save();
return redirect('/rounds');
}
}

View file

@ -4,25 +4,22 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Season;
use App\Payment;
use DB;
class UsersController extends Controller
{
public function main() {
return view('main');
}
public function index() {
$users = DB::table('users')->get();
$users = DB::table('users')->where('deleted',null)->get();
return view('users.index', compact('users'));
}
public function mypage() {
return view('mypage');
}
public function getAllUsersAsJson() {
$users = DB::table('users')->get();
return $users;
}
public function showUsers() {
$users = DB::table('users')->get();
return view('users.list', compact('users'));
@ -36,4 +33,46 @@ class UsersController extends Controller
//$user = DB::table('users')->find($id);
return view('users.show', compact('userObject'));
}
public function edit($user_id) {
$user = User::where('id',$user_id)->first();
$season_id = Season::getCurrent()->id;
$paid_date_str="";
$val=User::payment_date($user_id, $season_id);
if ($val) { $paid_date_str=$val;}
return view ('users.edit', compact('user','paid_date_str'));
}
public function store() {
$season_id = Season::getCurrent()->id;
// Validate form
$this->validate(request(), [
'id' => 'required',
'name' => 'required',
'email'=> 'required'
]);
// Create and save the season
$user=User::where('id', request('id'))->first();
$user->name=request('name');
$user->email=request('email');
if (request()->has('admin')) { $user->admin=request('admin'); }
$user->save();
if (request()->has('paid')) {
Payment::set_payment_date(request('id'), $season_id, request('paid'));
}
// Redirect to the home page
return redirect('/users');
}
}

View file

@ -6,5 +6,31 @@ use Illuminate\Database\Eloquent\Model;
class Payment extends Model
{
//
protected $fillable = [
'season_id', 'user_id', 'paid_date'
];
public static function set_payment_date($user_id,$season_id,$paid_date) {
$payment = Payment::where([
['user_id', '=', $user_id],
['season_id', '=', $season_id]
])->first();
if (!$payment) {
$payment= Payment::create([
'user_id' => $user_id,
'season_id'=> $season_id,
'paid_date'=> $paid_date
]);
} else {
$payment->user_id = $user_id;
$payment->season_id = $season_id;
$payment->paid_date = $paid_date;
}
$payment->save();
}
}

View file

@ -6,5 +6,11 @@ use Illuminate\Database\Eloquent\Model;
class Round extends Model
{
//
protected $fillable = [
'name','season_id'
];
public function games() {
return $this->hasMany('App\Game');
}
}

View file

@ -4,6 +4,8 @@ namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Season;
use App\Payment;
class User extends Authenticatable
{
@ -26,4 +28,37 @@ class User extends Authenticatable
protected $hidden = [
'password', 'remember_token',
];
// Only the current season.
public static function is_season_paid($user_id) {
$retval="Ja";
if (User::payment_date($user_id, Season::getCurrent()->id)==null) { $retval="Nein"; }
return $retval;
}
public static function payment_date($user_id,$season_id) {
$season = Season::getCurrent();
if ($season) {
$payment = Payment::where([
['user_id', '=', $user_id],
['season_id', '=', $season->id]
])->first();
if ($payment) {
if ($payment->paid_date) {
return $payment->paid_date;
}
} else {
$payment= Payment::create([
'user_id' => $user_id,
'season_id'=> $season->id,
'paid_date'=> null
]);
$payment->save();
}
}
return null;
}
}

View file

@ -7,7 +7,8 @@
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0"
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.4"
},
"require-dev": {
"fzaninotto/faker": "~1.4",

View file

@ -177,6 +177,7 @@ return [
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
],
@ -207,8 +208,10 @@ return [
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Form' => Collective\Html\FormFacade::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Html' => Collective\Html\HtmlFacade::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,

View file

@ -18,7 +18,8 @@ class CreateUsersTable extends Migration
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->boolean('is_admin')->default(false);
$table->timestamp('deleted')->nullable();
$table->boolean('admin')->default(false);
$table->rememberToken();
$table->timestamps();

View file

@ -17,7 +17,7 @@ class CreatePaymentsTable extends Migration
$table->increments('id');
$table->integer('season_id');
$table->integer('user_id');
$table->dateTime('paid_date');
$table->dateTime('paid_date')->nullable();
$table->timestamps();
});
}

View file

@ -18,8 +18,8 @@ class CreateGamesTable extends Migration
$table->integer('round_id');
$table->string('team1');
$table->string('team2');
$table->integer('score1');
$table->integer('score2');
$table->integer('score1')->default(-1);
$table->integer('score2')->default(-1);
$table->dateTime('kickoff');
$table->timestamps();
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
pfosten/public/js/jquery-3.2.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,43 @@
@extends('layouts.layout')
@section('content')
<div class="col-md-8">
<h1>Spiel bearbeiten</h1>
<form method="POST" action="/games/store">
{{ csrf_field() }}
<div class="form-group">
<div style="float:left; width:150px">
<input type="text" class="form-control" id="team1" name="team1" value="{{ $game->team1 }}" required>
</div>
<div style="float:left; width:150px">
<input type="text" class="form-control" id="team2" name="team2" value="{{ $game->team2 }}" required>
</div>
<div style="float:left; width:25px">&nbsp;&nbsp;&nbsp;</div>
<div style="float:left; width:40px">
<input type="text" class="form-control" id="score1" name="score1" value="{{ $game->score1 }}" required>
</div>
<div style="float:left; width:15px">&nbsp; : &nbsp;</div>
<div style="float:left; width:40px">
<input type="text" class="form-control" id="score2" name="score2" value="{{ $game->score2}}" required>
</div>
<div style="float:left; width:25px">&nbsp;&nbsp;&nbsp;</div>
<!--<div style="float:left; width:175px">-->
<div style="float:left; width:225px">
<!-- <input type="datetime-local" class="form-control" id="kickoff" name="kickoff" value="{{ $game->kickoff}}" required> -->
<input type="text" class="has_datepicker" id="kickoff" name="kickoff" value="{{ $game->kickoff }}" required>
</div>
<input type="hidden" name="id" value="{{ $game->id }}">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Ok</button>
</div>
</form>
</div>
@endsection

View file

@ -5,4 +5,14 @@
<p>Tel. 0172xxxxxxx, vg@aol.com</p>
</div>
<script src="/js/jquery-3.2.1.min.js"></script>
<script src="/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript">
$(".has_datepicker").datetimepicker({format: 'yyyy-mm-dd hh:ii'});
</script>
</footer>

View file

@ -1,29 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Hoschis Vollpfosten</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Hoschis Vollpfosten</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="/css/bootstrap-datetimepicker.min.css">
<!-- Custom styles for this template -->
<link href="/css/album.css" rel="stylesheet">
</head>
<!-- Custom styles for this template -->
<link href="/css/album.css" rel="stylesheet">
</head>
<body>
<body>
@include('layouts.nav')
@include('layouts.nav')
<div class="container">
@yield('content')
</div>
<div class="container">
@yield('content')
</div>
@include('layouts.footer')
@include('layouts.footer')
</body>
</body>
</html>

View file

@ -5,7 +5,7 @@
@if (Auth::check())
<a class="lead" href="/seasons">Saison</a> &nbsp; &nbsp; &nbsp;
<a class="lead" href="/rounds">Runden</a> &nbsp; &nbsp; &nbsp;
<a class="lead" href="#">Spieler</a> &nbsp; &nbsp; &nbsp;
<a class="lead" href="/users">Spieler</a> &nbsp; &nbsp; &nbsp;
<a class="lead" href="#">Tipps</a> &nbsp; &nbsp; &nbsp;
<a class="lead" href="/register" >Rangliste</a> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;

View file

@ -0,0 +1,32 @@
@extends('layouts.layout')
@section('content')
<section class="jumbotron text-center">
<div class="container">
<h1 class="jumbotron-heading">Hoschis Vollpfosten</h1>
<p class="lead text-muted">Eine Tippgemeinschaft unter Freunden.</p>
<div><p></p><p></p><p></p></div>
@if (!Auth::check())
<div>
<a href="/login" class="btn btn-primary">Anmelden</a>
</div>
<div><p></p><p></p><p></p></div>
</div>
<a href="/register" class="btn btn-primary">Registrieren</a>
</div>
@endif
@if (Auth::check())
<div class="lead"> </div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
@endif
</section>
@endsection

View file

@ -1,5 +0,0 @@
<!doctype html>
<html>
<head><title></title></head>
<body><h1>Hello World</h1></body>
</html>

View file

@ -2,7 +2,10 @@
@section('content')
<div class="col-md-8">
<h1>Runde erstellen</h1>
@if($currentSeason==null)
<h1>Bitte zuerst eine Saison erstellen</h1>
@endif
<h1>Runde erstellen für Saison:{{ $currentSeason->name }}</h1>
<form method="POST" action="/rounds/store">
@ -12,6 +15,87 @@
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="form-group" >
<label class="lead">Spiel 1</label>
<span class="form-group" style="float:right;width:400px;">
<label for="game1_team1">Team 1:</label>
<input type="text" class="form-control" id="game1_team1" name="game1_team1" required>
<label for="game1_team2">Team 2:</label>
<input type="text" class="form-control" id="game1_team2" name="game1_team2" required>
<label for="game1_kickoff">Anstoss:</label>
<input type="datetime-local" class="form-control" id="game1_kickoff" name="game1_kickoff" required>
</span>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="form-group" >
<label class="lead">Spiel 2</label>
<span class="form-group" style="float:right;width:400px;">
<label for="game2_team1">Team 1:</label>
<input type="text" class="form-control" id="game2_team1" name="game2_team1" required>
<label for="game1_team1">Team 2:</label>
<input type="text" class="form-control" id="game2_team2" name="game2_team2" required>
<label for="game2_kickoff">Anstoss:</label>
<input type="datetime-local" class="form-control" id="game2_kickoff" name="game2_kickoff" required>
</span>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="form-group" >
<label class="lead">Spiel 3</label>
<span class="form-group" style="float:right;width:400px;">
<label for="game3_team1">Team 1:</label>
<input type="text" class="form-control" id="game3_team1" name="game3_team1" required>
<label for="game3_team2">Team 2:</label>
<input type="text" class="form-control" id="game3_team2_name" name="game3_team2" required>
<label for="game3_kickoff">Anstoss:</label>
<input type="datetime-local" class="form-control" id="game3_kickoff" name="game3_kickoff" required>
</span>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="form-group" >
<label class="lead">Spiel 4</label>
<span class="form-group" style="float:right;width:400px;">
<label for="game4_team1">Team 1:</label>
<input type="text" class="form-control" id="game4_team1" name="game4_team1" required>
<label for="game4_team2">Team 2:</label>
<input type="text" class="form-control" id="game4_team2" name="game4_team2" required>
<label for="game4_kickoff">Anstoss:</label>
<input type="datetime-local" class="form-control" id="game4_kickoff" name="game4_kickoff" required>
</span>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Erstellen</button>
</div>

View file

@ -0,0 +1,27 @@
@extends('layouts.layout')
@section('content')
<div class="col-md-8">
<h1>Name der Runde:</h1>
<form method="POST" action="/rounds/storename">
{{ csrf_field() }}
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" name="name" value="{{ $round->name }}" required>
<input type="hidden" name="round_id" value="{{ $round->id }}">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Ok</button>
</div>
</form>
</div>
@endsection

View file

@ -5,24 +5,28 @@
<div class="container">
@if ($activeSeason)
<label>Aktive Saison:{{ $activeSeason->name }}</label>
<label>Saison:{{ $activeSeason->name }}</label>
@endif
<div class="lead">Runden Liste</div>
<div class="lead">Runden</div>
<div><a href="/rounds/create" class="btn btn-primary">Runde hinzufügen</a></div>
<p>&nbsp;</p>
@if ($activeSeason)
<div>
<ul>
@foreach($rounds as $round)
<li class="text list-unstyled">{{ $round->name }}</li>
@foreach($rounds->reverse() as $round)
<div><a class="text lead" href="/rounds/editname/{{ $round->id }}">{{ $round->name }} </a></div>
@foreach($round->games as $game)
<div><a class="text" href="/games/edit/{{ $game->id }}">{{ $game->team1 }} : {{ $game->team2 }} [ Anstoss {{ $game->kickoff }} ] </a></div>
@endforeach
</ul>
<p>&nbsp;</p>
@endforeach
</div>
@endif
<div><a href="/rounds/create" class="btn btn-primary">Neue anlegen</a></div>

View file

@ -3,13 +3,13 @@
@section('content')
<section class="jumbotron text-center">
<div class="container">
<div class="lead">Saison Liste</div>
@if ($activeSeason)
<div class="lead">Saison: {{ $activeSeason->name }}</div>
@endif
@if ($activeSeason)
<div>
<ul>
@foreach($seasons as $season)
<li class="text list-unstyled">{{ $season->name }}</li>
@endforeach
@ -17,15 +17,7 @@
</div>
@endif
<div> <a href="/seasons/create" class="btn btn-primary">Neue anlegen</a></div>
@if ($activeSeason)
<div class="container">
<label>Aktive Saison:{{ $activeSeason->name }}</label>
</div>
@endif
<div><a href="/seasons/create" class="btn btn-primary">Neue anlegen</a></div>
</div>

View file

@ -0,0 +1,53 @@
@extends('layouts.layout')
@section('content')
<div class="col-md-8">
<h1>Spieler bearbeiten</h1>
<a style="float:right;" href="#" class="btn btn-primary">Spielerkonto löschen</a>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<form method="POST" action="/users/store" id="playerform">
{{ csrf_field() }}
<div class="form-group">
<div>
<label style="float:left; width:150px" for="name">Name:</label>
<input type="text" class="form-control" id="name" name="name" value="{{ $user->name }}" required>
</div>
<p>&nbsp;</p>
<div>
<label style="float:left; width:150px" for="name">Zahlung für Saison:</label>
<input style="width:150px" type="text" class="form-control has_datepicker" id="paid" name="paid" value="{{ $paid_date_str }}" >
</div>
<p>&nbsp;</p>
<div>
<label style="float:left; width:150px" for="name">Email:</label>
<input style="width:150px" type="text" class="form-control" id="email" name="email" value="{{ $user->email }}" required>
</div>
<p>&nbsp;</p>
<div>
<label style="float:left; width:150px;" for="admin">Admin:</label>
{{ Form::checkbox('admin', 'value', $user->admin ) }}
</div>
<input type="hidden" name="id" value="{{ $user->id }}">
</div>
<div class="form-group">
<p>&nbsp;</p>
<p>&nbsp;</p>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><button type="submit" class="btn btn-primary" style="float:none; width:100px">Ok</button>
</div>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
@endsection

View file

@ -3,37 +3,47 @@
@section('content')
<section class="jumbotron text-center">
<div class="container">
<h1 class="jumbotron-heading">Hoschis Vollpfosten</h1>
<p class="lead text-muted">Eine Tippgemeinschaft unter Freunden.</p>
<div><p></p><p></p><p></p></div>
@if (!Auth::check())
<div>
<a href="/login" class="btn btn-primary">Anmelden</a>
</div>
<div><p></p><p></p><p></p></div>
</div>
<a href="/register" class="btn btn-primary">Registrieren</a>
</div>
@endif
@if (Auth::check())
<div class="lead">Spieler:</div>
<div class="lead"> Spielerliste:</div>
<p>&nbsp;</p>
<div>
<ul>
@foreach($users as $user)
<li class="text list-unstyled">{{ $user->name }}</li>
@endforeach
</ul>
</div>
<!--
<div>
<a href="/logout" class="btn btn-primary">Abmelden</a>
</div>
-->
@endif
<div>
<table class="table-bordered">
<tr class="table-bordered">
<td class="table-bordered">Name</td>
<td class="table-bordered">&nbsp;Saison bezahlt&nbsp;</td>
<td class="table-bordered">Status</td>
</tr>
@foreach($users as $user)
<tr>
<td class="table-bordered">&nbsp;<a class="text list-unstyled" href="/users/edit/{{$user->id}}">{{ $user->name }}&nbsp;</a></td>
<td class="table-bordered">{{ App\User::is_season_paid($user->id) }}</td>
<td class="table-bordered">&nbsp;{{ ($user->admin ? "Administrator":"Spieler") }}&nbsp;</td>
</tr>
@endforeach
</table>
<p>&nbsp;</p>
</div>
</div>
</section>
@endsection
@endsection

View file

@ -1,9 +0,0 @@
<!doctype html>
<html>
<head><title></title></head>
<body><h1>User: {{$userObject->name}} </h1>
</body>
</html>

View file

@ -1,95 +0,0 @@
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Raleway', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links > a {
color: #636b6f;
padding: 0 25px;
font-size: 12px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@if (Auth::check())
<a href="{{ url('/home') }}">Home</a>
@else
<a href="{{ url('/login') }}">Login</a>
<a href="{{ url('/register') }}">Register</a>
@endif
</div>
@endif
<div class="content">
<div class="title m-b-md">
Laracast
</div>
<div class="links">
<a href="https://laravel.com/docs">Documentation</a>
<a href="https://laracasts.com">Laracasts</a>
<a href="https://laravel-news.com">News</a>
<a href="https://forge.laravel.com">Forge</a>
<a href="https://github.com/laravel/laravel">GitHub</a>
</div>
</div>
</div>
</body>
</html>

View file

@ -20,7 +20,7 @@ Route::post('/login','SessionsController@store');
Route::get('/logout','SessionsController@destroy');
Route::get('/','UsersController@index')->name('home');
Route::get('/','UsersController@main')->name('home');
Route::get('/seasons','SeasonsController@index');
Route::get('/seasons/create','SeasonsController@create');
@ -30,17 +30,13 @@ Route::get('/rounds','RoundsController@index');
Route::get('/rounds/create','RoundsController@create');
Route::post('/rounds/store','RoundsController@store');
Route::get('/rounds/editname/{round_id}','RoundsController@editname');
Route::post('/rounds/storename', 'RoundsController@storename');
Route::get('/games/edit/{game_id}', 'GamesController@edit');
Route::post('/games/store', 'GamesController@store');
Route::get('mypage','UsersController@mypage');
Route::get('/api/users', 'UsersController@getAllUsersAsJson');
Route::get('/users', 'UsersController@showUsers');
Route::get('/users/{userObject}', 'UsersController@showUser');
Route::get('/users','UsersController@index');
Route::get('/users/edit/{user_id}','UsersController@edit');
Route::post('/users/store','UsersController@store');