Skip to content

Commit c7f7685

Browse files
committed
Update to Laravel 5.4
1 parent 4a96707 commit c7f7685

Some content is hidden

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

71 files changed

+2985
-1761
lines changed

.env.example

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
APP_NAME=Laravel
12
APP_ENV=local
3+
APP_KEY=
24
APP_DEBUG=true
3-
APP_KEY=SomeRandomString
4-
APP_URL=http://laravel-starter.dev/
5-
PUBLIC_FOLDER=public
5+
APP_LOG_LEVEL=debug
6+
APP_URL=http://localhost
67

78
APP_TITLE="Laravel Starter"
89
APP_DESCRIPTION="Laravel Starter with AdminLTE theme"
@@ -12,31 +13,34 @@ APP_KEYWORDS="laravel titan starter project admin adminlte"
1213
DB_CONNECTION=mysql
1314
DB_HOST=127.0.0.1
1415
DB_PORT=3306
15-
DB_DATABASE=laravel_starter
16-
DB_USERNAME=root
17-
DB_PASSWORD=
16+
DB_DATABASE=homestead
17+
DB_USERNAME=homestead
18+
DB_PASSWORD=secret
1819

20+
BROADCAST_DRIVER=log
1921
CACHE_DRIVER=file
2022
SESSION_DRIVER=file
21-
QUEUE_DRIVER=database
23+
QUEUE_DRIVER=sync
2224

2325
REDIS_HOST=127.0.0.1
2426
REDIS_PASSWORD=null
2527
REDIS_PORT=6379
2628

27-
MAIL_DRIVER=log
28-
MAIL_HOST=smtp.mailgun.org
29-
MAIL_PORT=587
29+
MAIL_DRIVER=smtp
30+
MAIL_HOST=smtp.mailtrap.io
31+
MAIL_PORT=2525
3032
MAIL_USERNAME=null
3133
MAIL_PASSWORD=null
3234
MAIL_ENCRYPTION=null
3335

3436
MAIL_ADMIN="Admin Name"
3537
MAIL_ADMIN_EMAIL="[email protected]"
36-
MAIL_NAME="Mail Name"
37-
MAIL_ADDRESS="[email protected]"
38-
MAILGUN_SECRET=null
39-
MAILGUN_DOMAIN=null
38+
MAIL_FROM_NAME="ADmin"
39+
MAIL_FROM_ADDRESS=[email protected]
40+
41+
PUSHER_APP_ID=
42+
PUSHER_APP_KEY=
43+
PUSHER_APP_SECRET=
4044

4145
FACEBOOK_APP_ID=null
4246
RECAPTCHA_PUBLIC_KEY=null

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* text=auto
22
*.css linguist-vendored
3-
*.less linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
/vendor
21
/node_modules
2+
/public/hot
33
/public/storage
4-
Homestead.yaml
4+
/storage/*.key
5+
/vendor
6+
/.idea
7+
/.vagrant
58
Homestead.json
9+
Homestead.yaml
10+
npm-debug.log
611
.env
7-
.env.live
8-
.idea
912
_ide_helper.php
10-
Thumbs.db
11-
_notes/
12-
resources/stubs/
13-
public/uploads/
14-
TODO.txt
13+
.phpstorm.meta.php

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Laravel CMS Starter Project
22

33
A Laravel CMS Starter project with AdminLTE theme and core features.
4+
- Laravel 5.4
5+
- Laravel 5.2 (Branch Laravel 5.2)
46

57
[Preview project here](http://bpocallaghan.co.za/admin)
68
@@ -33,10 +35,10 @@ A Laravel CMS Starter project with AdminLTE theme and core features.
3335
- ```php artisan migrate```
3436
- ```php artisan db:seed```
3537
- open database\seeds\UserTableSeeder.php to create a different admin
36-
- open your browser (http://laravel-starter.dev/)
38+
- open your browser (http://laravel-admin.dev/)
3739
- the home, about, contact us gets generated + the breadcrumb
38-
- log into the admin (http://laravel-starter.dev/admin)
39-
- admin@laravel-starter.com
40+
- log into the admin (http://laravel-admin.dev/admin)
41+
- admin@laravel-admin.com
4042
- admin
4143

4244
## Setup (Advanced)

app/Console/Commands/Inspire.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/Console/Kernel.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
1313
* @var array
1414
*/
1515
protected $commands = [
16-
// Commands\Inspire::class,
16+
//
1717
];
1818

1919
/**
@@ -27,4 +27,14 @@ protected function schedule(Schedule $schedule)
2727
// $schedule->command('inspire')
2828
// ->hourly();
2929
}
30+
31+
/**
32+
* Register the Closure based commands for the application.
33+
*
34+
* @return void
35+
*/
36+
protected function commands()
37+
{
38+
require base_path('routes/console.php');
39+
}
3040
}

app/Events/Event.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/Exceptions/Handler.php

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
namespace App\Exceptions;
44

55
use Exception;
6-
use Illuminate\Validation\ValidationException;
7-
use Illuminate\Auth\Access\AuthorizationException;
8-
use Illuminate\Database\Eloquent\ModelNotFoundException;
9-
use Symfony\Component\HttpKernel\Exception\HttpException;
6+
use Illuminate\Auth\AuthenticationException;
107
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
118

129
class Handler extends ExceptionHandler
@@ -17,34 +14,52 @@ class Handler extends ExceptionHandler
1714
* @var array
1815
*/
1916
protected $dontReport = [
20-
AuthorizationException::class,
21-
HttpException::class,
22-
ModelNotFoundException::class,
23-
ValidationException::class,
17+
\Illuminate\Auth\AuthenticationException::class,
18+
\Illuminate\Auth\Access\AuthorizationException::class,
19+
\Symfony\Component\HttpKernel\Exception\HttpException::class,
20+
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
21+
\Illuminate\Session\TokenMismatchException::class,
22+
\Illuminate\Validation\ValidationException::class,
2423
];
2524

2625
/**
2726
* Report or log an exception.
2827
*
2928
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
3029
*
31-
* @param \Exception $e
30+
* @param \Exception $exception
3231
* @return void
3332
*/
34-
public function report(Exception $e)
33+
public function report(Exception $exception)
3534
{
36-
parent::report($e);
35+
parent::report($exception);
3736
}
3837

3938
/**
4039
* Render an exception into an HTTP response.
4140
*
4241
* @param \Illuminate\Http\Request $request
43-
* @param \Exception $e
42+
* @param \Exception $exception
4443
* @return \Illuminate\Http\Response
4544
*/
46-
public function render($request, Exception $e)
45+
public function render($request, Exception $exception)
4746
{
48-
return parent::render($request, $e);
47+
return parent::render($request, $exception);
48+
}
49+
50+
/**
51+
* Convert an authentication exception into an unauthenticated response.
52+
*
53+
* @param \Illuminate\Http\Request $request
54+
* @param \Illuminate\Auth\AuthenticationException $exception
55+
* @return \Illuminate\Http\Response
56+
*/
57+
protected function unauthenticated($request, AuthenticationException $exception)
58+
{
59+
if ($request->expectsJson()) {
60+
return response()->json(['error' => 'Unauthenticated.'], 401);
61+
}
62+
63+
return redirect()->guest(route('login'));
4964
}
5065
}

app/Http/Controllers/Admin/Geography/CitiesController.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ class CitiesController extends TitanAdminController
2121
*/
2222
public function index()
2323
{
24-
return $this->view('geography.cities.index')
25-
->with('items', City::with('country')->get());
24+
session()->put('url', request()->url());
25+
26+
return $this->view('geography.cities.index')->with('items', City::with('country')->get());
2627
}
2728

2829
/**
@@ -32,8 +33,7 @@ public function index()
3233
*/
3334
public function create()
3435
{
35-
return $this->view('geography.cities.add_edit')
36-
->with('countries', Country::getAllLists());
36+
return $this->view('geography.cities.add_edit')->with('countries', Country::getAllLists());
3737
}
3838

3939
/**
@@ -48,60 +48,60 @@ public function store(Request $request)
4848

4949
$this->createEntry(City::class, $request->except('files'));
5050

51-
return route_admin('geography.cities.index');
51+
return redirect(session('url'));
5252
}
5353

5454
/**
5555
* Display the specified city.
5656
*
57-
* @param City $cities
57+
* @param City $city
5858
* @return Response
5959
*/
60-
public function show(City $cities)
60+
public function show(City $city)
6161
{
62-
return $this->view('geography.cities.show')->with('item', $cities);
62+
return $this->view('geography.cities.show')->with('item', $city);
6363
}
6464

6565
/**
6666
* Show the form for editing the specified city.
6767
*
68-
* @param City $cities
68+
* @param City $city
6969
* @return Response
7070
*/
71-
public function edit(City $cities)
71+
public function edit(City $city)
7272
{
7373
return $this->view('geography.cities.add_edit')
74-
->with('item', $cities)
74+
->with('item', $city)
7575
->with('countries', Country::getAllLists());
7676
}
7777

7878
/**
7979
* Update the specified city in storage.
8080
*
81-
* @param City $cities
81+
* @param City $city
8282
* @param Request $request
8383
* @return Response
8484
*/
85-
public function update(City $cities, Request $request)
85+
public function update(City $city, Request $request)
8686
{
8787
$this->validate($request, City::$rules, City::$messages);
8888

89-
$this->updateEntry($cities, $request->except('files'));
89+
$this->updateEntry($city, $request->except('files'));
9090

91-
return route_admin('geography.cities.index');
91+
return redirect(session('url'));
9292
}
9393

9494
/**
9595
* Remove the specified city from storage.
9696
*
97-
* @param City $cities
97+
* @param City $city
9898
* @param Request $request
9999
* @return Response
100100
*/
101-
public function destroy(City $cities, Request $request)
101+
public function destroy(City $city, Request $request)
102102
{
103-
$this->deleteEntry($cities, $request);
103+
$this->deleteEntry($city, $request);
104104

105-
return route_admin('geography.cities.index');
105+
return redirect(session('url'));
106106
}
107107
}

0 commit comments

Comments
 (0)