forked from s421507/eOSP2
Jednostki
This commit is contained in:
parent
6c2710feed
commit
a37c9f429a
@ -68,7 +68,6 @@ class RegistrationController extends Controller
|
|||||||
'surname' => 'required',
|
'surname' => 'required',
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'password' => 'required',
|
'password' => 'required',
|
||||||
'login' => 'required',
|
|
||||||
'PESEL' => 'required',
|
'PESEL' => 'required',
|
||||||
'phoneNumber' => 'required'
|
'phoneNumber' => 'required'
|
||||||
|
|
||||||
@ -77,7 +76,6 @@ class RegistrationController extends Controller
|
|||||||
|
|
||||||
$request = request();
|
$request = request();
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'login' => $request-> login,
|
|
||||||
'password' => $request-> password,
|
'password' => $request-> password,
|
||||||
'email' => $request-> email,
|
'email' => $request-> email,
|
||||||
'name' => $request-> name,
|
'name' => $request-> name,
|
||||||
|
@ -13,7 +13,7 @@ class SessionsController extends Controller
|
|||||||
|
|
||||||
public function store()
|
public function store()
|
||||||
{
|
{
|
||||||
if (auth()->attempt(request(['login', 'password'])) == false) {
|
if (auth()->attempt(request(['email', 'password'])) == false) {
|
||||||
return back()->withErrors([
|
return back()->withErrors([
|
||||||
'message' => 'The email or password is incorrect, please try again'
|
'message' => 'The email or password is incorrect, please try again'
|
||||||
]);
|
]);
|
||||||
|
@ -18,7 +18,7 @@ class User extends Authenticatable
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
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',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,6 @@ class CreateUsersTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('users', function (Blueprint $table) {
|
Schema::create('users', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('login', 45);
|
|
||||||
$table->string('password', 100);
|
$table->string('password', 100);
|
||||||
$table->string('name', 45);
|
$table->string('name', 45);
|
||||||
$table->string('surname', 45);
|
$table->string('surname', 45);
|
||||||
|
@ -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');
|
|
||||||
}
|
|
||||||
}
|
|
@ -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');
|
|
||||||
}
|
|
||||||
}
|
|
@ -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');
|
||||||
|
}
|
||||||
|
}
|
11
resources/views/inc/formerrors.blade.php
Normal file
11
resources/views/inc/formerrors.blade.php
Normal 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
|
@ -7,8 +7,8 @@
|
|||||||
<form method="POST" action="/login">
|
<form method="POST" action="/login">
|
||||||
{{ csrf_field() }}
|
{{ csrf_field() }}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="name">Login:</label>
|
<label for="email">Email:</label>
|
||||||
<input type="text" class="form-control" id="login" name="login">
|
<input type="text" class="form-control" id="email" name="email">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -19,7 +19,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Login</button>
|
<button style="cursor:pointer" type="submit" class="btn btn-primary">Login</button>
|
||||||
</div>
|
</div>
|
||||||
{{-- @include('partials.formerrors')--}}
|
@include('inc.formerrors')
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -72,11 +72,6 @@
|
|||||||
<input type="text" class="form-control" id="surname" name="surname">
|
<input type="text" class="form-control" id="surname" name="surname">
|
||||||
</div>
|
</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">
|
<div class="form-group">
|
||||||
<label for="name">Pesel:</label>
|
<label for="name">Pesel:</label>
|
||||||
<input type="text" class="form-control" id="PESEL" name="PESEL">
|
<input type="text" class="form-control" id="PESEL" name="PESEL">
|
||||||
@ -100,7 +95,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
|
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
{{-- @include('partials.formerrors')--}}
|
@include('inc.formerrors')
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
Loading…
Reference in New Issue
Block a user