Jednostki

This commit is contained in:
czup 2019-09-17 19:59:20 +02:00
parent 6c2710feed
commit a37c9f429a
10 changed files with 66 additions and 76 deletions

View File

@ -68,7 +68,6 @@ class RegistrationController extends Controller
'surname' => 'required',
'email' => 'required|email',
'password' => 'required',
'login' => 'required',
'PESEL' => 'required',
'phoneNumber' => 'required'
@ -77,7 +76,6 @@ class RegistrationController extends Controller
$request = request();
$user = User::create([
'login' => $request-> login,
'password' => $request-> password,
'email' => $request-> email,
'name' => $request-> name,

View File

@ -13,7 +13,7 @@ class SessionsController extends Controller
public function store()
{
if (auth()->attempt(request(['login', 'password'])) == false) {
if (auth()->attempt(request(['email', 'password'])) == false) {
return back()->withErrors([
'message' => 'The email or password is incorrect, please try again'
]);

View File

@ -18,7 +18,7 @@ class User extends Authenticatable
* @var array
*/
protected $fillable = [
'login', 'name', 'surname', 'password', 'PESEL', 'phoneNumber', 'email', 'fireStationID', 'functionID', 'degreeID', 'number', 'statusID', 'deleted', 'creatorID', 'changingID',
'name', 'surname', 'password', 'PESEL', 'phoneNumber', 'email', 'fireStationID', 'functionID', 'degreeID', 'number', 'statusID', 'deleted', 'creatorID', 'changingID',
];
/**

View File

@ -15,7 +15,6 @@ class CreateUsersTable extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('login', 45);
$table->string('password', 100);
$table->string('name', 45);
$table->string('surname', 45);

View File

@ -1,31 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFlightsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('flights', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('flights');
}
}

View File

@ -1,31 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUzytkowniksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('uzytkowniks', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('uzytkowniks');
}
}

View File

@ -0,0 +1,49 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFireStationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('fireStations', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 45);
$table->integer('number');
$table->string('voivodeship', 45);
$table->string('county', 45);
$table->string('community', 45);
$table->string('postOffice', 45);
$table->string('zipCode', 6);
$table->string('address', 45);
$table->float('latitude', 9,5);
$table->float('longitude', 9,5);
$table->string('KRS', 10);
$table->string('NIP', 10);
$table->string('phoneNumber', 11);
$table->string('email', 100);
$table->integer('deleted')->default(0);
$table->integer('creatorID')->nullable()->default(null);
$table->integer('changingID')->nullable()->default(null);
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('fireStations');
}
}

View File

@ -0,0 +1,11 @@
@if(count($errors))
<div class="form-group">
<div class="alert alert-danger">
<ul>
@foreach($errors->all() as $error)
<li>{{$error}}</li>
@endforeach
</ul>
</div>
</div>
@endif

View File

@ -7,8 +7,8 @@
<form method="POST" action="/login">
{{ csrf_field() }}
<div class="form-group">
<label for="name">Login:</label>
<input type="text" class="form-control" id="login" name="login">
<label for="email">Email:</label>
<input type="text" class="form-control" id="email" name="email">
</div>
<div class="form-group">
@ -19,7 +19,7 @@
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Login</button>
</div>
{{-- @include('partials.formerrors')--}}
@include('inc.formerrors')
</form>
@endsection

View File

@ -72,11 +72,6 @@
<input type="text" class="form-control" id="surname" name="surname">
</div>
<div class="form-group">
<label for="name">Login:</label>
<input type="text" class="form-control" id="login" name="login">
</div>
<div class="form-group">
<label for="name">Pesel:</label>
<input type="text" class="form-control" id="PESEL" name="PESEL">
@ -100,7 +95,7 @@
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
</div>
{{-- @include('partials.formerrors')--}}
@include('inc.formerrors')
</form>
@stop