Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 2faa70e

Browse files
authored
Merge pull request #27 from Saibamen/laravel_5.6
Laravel 5.6, Bootstrap 4
2 parents 8a45b98 + 3c08dd5 commit 2faa70e

55 files changed

Lines changed: 2270 additions & 1129 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_style = space
16+
indent_size = 2

.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ APP_NAME=Laravel
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_LOG_LEVEL=debug
65
APP_URL=http://localhost
76

7+
LOG_CHANNEL=daily
8+
89
DB_CONNECTION=mysql
910
DB_HOST=127.0.0.1
1011
DB_PORT=3306
@@ -33,3 +34,6 @@ PUSHER_APP_ID=
3334
PUSHER_APP_KEY=
3435
PUSHER_APP_SECRET=
3536
PUSHER_APP_CLUSTER=mt1
37+
38+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
/storage/*.key
55
/vendor
66
/.idea
7+
/.vscode
78
/.vagrant
89
Homestead.json
910
Homestead.yaml
1011
npm-debug.log
1112
yarn-error.log
1213
.env
14+
.phpunit.result.cache
1315

1416
# Created by https://www.gitignore.io/api/sublimetext,notepadpp,windows
1517

@@ -141,8 +143,6 @@ sh.exe.stackdump
141143

142144
### Own rules ###
143145
/_ide_helper.php
144-
bootstrap/cache/*
145-
!bootstrap/cache/.gitkeep
146146

147147
### Yarn 2
148148
.yarn/*

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: php
22

3-
dist: trusty
3+
dist: trusty # TODO: Migrate to xenial: https://docs.travis-ci.com/user/trusty-to-xenial-migration-guide
44

55
cache:
66
directories:
@@ -12,7 +12,6 @@ os:
1212
#- osx
1313

1414
php:
15-
- 7.0
1615
- 7.1
1716
- 7.2
1817
- 7.3
@@ -36,11 +35,12 @@ env:
3635

3736
matrix:
3837
include:
39-
- php: 7.0.0
38+
# Minimum PHP version for Laravel 5.6 is 7.1.3
39+
- php: 7.1.3
4040
dist: precise
4141
env: DB=sqlite DB_CONNECTION=sqlite
4242

43-
- php: 7.0.0
43+
- php: 7.1.3
4444
dist: precise
4545
env: DB=postgres DB_CONNECTION=pgsql
4646

@@ -50,6 +50,7 @@ addons:
5050
mariadb: '10.0'
5151

5252
before_install:
53+
#- sudo mount -o remount,size=50% /var/ramfs # https://docs.travis-ci.com/user/trusty-to-xenial-migration-guide
5354
- sh -c "if [ '$DB' = 'sqlite' ]; then echo 'Creating database'; touch database/database.sqlite; fi"
5455
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS homestead_test;' -U postgres; fi"
5556
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'CREATE DATABASE homestead_test;' -U postgres; fi"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
[![SymfonyInsight](https://insight.symfony.com/projects/37d84994-c778-4373-94f2-a3218c22f96d/mini.svg)](https://insight.symfony.com/projects/37d84994-c778-4373-94f2-a3218c22f96d)
1010
[![codecov](https://codecov.io/gh/Saibamen/HotelManager/branch/master/graph/badge.svg)](https://codecov.io/gh/Saibamen/HotelManager)
1111

12-
Web application for managing hotel rooms, guests and reservations with flexible and responsive frontend written in [Laravel](https://laravel.com) 5.5
12+
Web application for managing hotel rooms, guests and reservations with flexible and responsive frontend written in [Laravel](https://laravel.com) 5.6
1313

1414
![All reservations](github_images/all_reservations.PNG)
1515

1616
## Requirements
1717

18-
* [PHP](http://php.net) >= 7.0.0
18+
* [PHP](http://php.net) >= 7.1.3
1919
* OpenSSL PHP Extension
2020
* PDO PHP Extension
2121
* Mbstring PHP Extension

app/Exceptions/Handler.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class Handler extends ExceptionHandler
2929
/**
3030
* Report or log an exception.
3131
*
32-
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
33-
*
3432
* @param \Exception $exception
3533
*
3634
* @return void

app/Http/Kernel.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Kernel extends HttpKernel
1414
* @var array
1515
*/
1616
protected $middleware = [
17-
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
17+
\App\Http\Middleware\CheckForMaintenanceMode::class,
1818
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
1919
\App\Http\Middleware\TrimStrings::class,
2020
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
@@ -51,12 +51,14 @@ class Kernel extends HttpKernel
5151
* @var array
5252
*/
5353
protected $routeMiddleware = [
54-
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
55-
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
56-
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
57-
'can' => \Illuminate\Auth\Middleware\Authorize::class,
58-
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
59-
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
60-
'admin' => \App\Http\Middleware\Admin::class,
54+
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
55+
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
56+
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
57+
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
58+
'can' => \Illuminate\Auth\Middleware\Authorize::class,
59+
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
60+
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
61+
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
62+
'admin' => \App\Http\Middleware\Admin::class,
6163
];
6264
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
6+
7+
class CheckForMaintenanceMode extends Middleware
8+
{
9+
/**
10+
* The URIs that should be reachable while maintenance mode is enabled.
11+
*
12+
* @var array
13+
*/
14+
protected $except = [
15+
//
16+
];
17+
}

app/Http/Middleware/TrustProxies.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@ class TrustProxies extends Middleware
1515
protected $proxies;
1616

1717
/**
18-
* The current proxy header mappings.
18+
* The headers that should be used to detect proxies.
1919
*
20-
* @var array
20+
* @var int
2121
*/
22-
protected $headers = [
23-
Request::HEADER_FORWARDED => 'FORWARDED',
24-
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
25-
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
26-
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
27-
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
28-
];
22+
protected $headers = Request::HEADER_X_FORWARDED_ALL;
2923
}

app/Models/Guest.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@
1919
* @property \Illuminate\Support\Carbon $updated_at
2020
* @property-read string $full_name
2121
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reservation[] $reservations
22+
* @property-read int|null $reservations_count
2223
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Room[] $rooms
24+
* @property-read int|null $rooms_count
2325
*
24-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereAddress($value)
25-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereContact($value)
26-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereCreatedAt($value)
27-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereFirstName($value)
28-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereId($value)
29-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereLastName($value)
30-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest wherePESEL($value)
31-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest wherePlace($value)
32-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereUpdatedAt($value)
33-
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereZipCode($value)
26+
* @method static \Illuminate\Database\Eloquent\Builder|Guest newModelQuery()
27+
* @method static \Illuminate\Database\Eloquent\Builder|Guest newQuery()
28+
* @method static \Illuminate\Database\Eloquent\Builder|Guest query()
29+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereAddress($value)
30+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereContact($value)
31+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereCreatedAt($value)
32+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereFirstName($value)
33+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereId($value)
34+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereLastName($value)
35+
* @method static \Illuminate\Database\Eloquent\Builder|Guest wherePESEL($value)
36+
* @method static \Illuminate\Database\Eloquent\Builder|Guest wherePlace($value)
37+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereUpdatedAt($value)
38+
* @method static \Illuminate\Database\Eloquent\Builder|Guest whereZipCode($value)
3439
* @mixin \Eloquent
3540
*/
3641
class Guest extends Model

0 commit comments

Comments
 (0)