Skip to content

Commit cdbb27a

Browse files
authored
Merge pull request #286 from pkracer/1.x
Laravel 8 Compatibility
2 parents f9f4632 + 3136bc4 commit cdbb27a

File tree

3 files changed

+37
-29
lines changed

3 files changed

+37
-29
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "^7.3||^7.4",
14-
"laravel/framework": "~7.0"
14+
"laravel/framework": "^7.0||^8.0"
1515
},
1616
"autoload": {
1717
"psr-4": {

src/Http/routes.php

+27-19
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
11
<?php
22

3+
use Wink\Http\Controllers\ImageUploadsController;
4+
use Wink\Http\Controllers\LoginController;
5+
use Wink\Http\Controllers\PagesController;
6+
use Wink\Http\Controllers\PostsController;
7+
use Wink\Http\Controllers\SPAViewController;
8+
use Wink\Http\Controllers\TagsController;
9+
use Wink\Http\Controllers\TeamController;
10+
311
// Blog Posts...
4-
Route::get('/api/posts', 'PostsController@index')->name('posts.index');
5-
Route::get('/api/posts/{id?}', 'PostsController@show')->name('posts.show');
6-
Route::post('/api/posts/{id}', 'PostsController@store')->name('posts.store');
7-
Route::delete('/api/posts/{id}', 'PostsController@delete')->name('posts.delete');
12+
Route::get('/api/posts', [PostsController::class, 'index'])->name('posts.index');
13+
Route::get('/api/posts/{id?}', [PostsController::class, 'show'])->name('posts.show');
14+
Route::post('/api/posts/{id}', [PostsController::class, 'store'])->name('posts.store');
15+
Route::delete('/api/posts/{id}', [PostsController::class, 'delete'])->name('posts.delete');
816

917
// Blog Tags...
10-
Route::get('/api/tags', 'TagsController@index')->name('tags.index');
11-
Route::get('/api/tags/{id?}', 'TagsController@show')->name('tags.show');
12-
Route::post('/api/tags/{id}', 'TagsController@store')->name('tags.store');
13-
Route::delete('/api/tags/{id}', 'TagsController@delete')->name('tags.delete');
18+
Route::get('/api/tags', [TagsController::class, 'index'])->name('tags.index');
19+
Route::get('/api/tags/{id?}', [TagsController::class, 'show'])->name('tags.show');
20+
Route::post('/api/tags/{id}', [TagsController::class, 'store'])->name('tags.store');
21+
Route::delete('/api/tags/{id}', [TagsController::class, 'delete'])->name('tags.delete');
1422

1523
// Blog Authors...
16-
Route::get('/api/team', 'TeamController@index')->name('team.index');
17-
Route::get('/api/team/{id?}', 'TeamController@show')->name('team.show');
18-
Route::post('/api/team/{id}', 'TeamController@store')->name('team.store');
19-
Route::delete('/api/team/{id}', 'TeamController@delete')->name('team.delete');
24+
Route::get('/api/team', [TeamController::class, 'index'])->name('team.index');
25+
Route::get('/api/team/{id?}', [TeamController::class, 'show'])->name('team.show');
26+
Route::post('/api/team/{id}', [TeamController::class, 'store'])->name('team.store');
27+
Route::delete('/api/team/{id}', [TeamController::class, 'delete'])->name('team.delete');
2028

2129
// Blog Image Uploads
22-
Route::post('/api/uploads', 'ImageUploadsController@upload')->name('images.store');
30+
Route::post('/api/uploads', [ImageUploadsController::class, 'upload'])->name('images.store');
2331

2432
// Blog Pages...
25-
Route::get('/api/pages', 'PagesController@index')->name('pages.index');
26-
Route::get('/api/pages/{id?}', 'PagesController@show')->name('pages.show');
27-
Route::post('/api/pages/{id}', 'PagesController@store')->name('pages.store');
28-
Route::delete('/api/pages/{id}', 'PagesController@delete')->name('pages.delete');
33+
Route::get('/api/pages', [PagesController::class, 'index'])->name('pages.index');
34+
Route::get('/api/pages/{id?}', [PagesController::class, 'show'])->name('pages.show');
35+
Route::post('/api/pages/{id}', [PagesController::class, 'store'])->name('pages.store');
36+
Route::delete('/api/pages/{id}', [PagesController::class, 'delete'])->name('pages.delete');
2937

3038
// Logout Route...
31-
Route::get('/logout', 'LoginController@logout')->name('logout');
39+
Route::get('/logout', [LoginController::class, 'logout'])->name('logout');
3240

3341
// Catch-all Route...
34-
Route::get('/{view?}', 'SPAViewController')->name('spa')->where('view', '(.*)');
42+
Route::get('/{view?}', SPAViewController::class)->name('spa')->where('view', '(.*)');

src/WinkServiceProvider.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Illuminate\Support\Facades\Route;
66
use Illuminate\Support\ServiceProvider;
7+
use Wink\Http\Controllers\ForgotPasswordController;
8+
use Wink\Http\Controllers\LoginController;
79
use Wink\Http\Middleware\Authenticate;
810

911
class WinkServiceProvider extends ServiceProvider
@@ -33,22 +35,20 @@ private function registerRoutes()
3335
{
3436
$middlewareGroup = config('wink.middleware_group');
3537

36-
Route::namespace('Wink\Http\Controllers')
37-
->middleware($middlewareGroup)
38+
Route::middleware($middlewareGroup)
3839
->as('wink.')
3940
->domain(config('wink.domain'))
4041
->prefix(config('wink.path'))
4142
->group(function () {
42-
Route::get('/login', 'LoginController@showLoginForm')->name('auth.login');
43-
Route::post('/login', 'LoginController@login')->name('auth.attempt');
43+
Route::get('/login', [LoginController::class, 'showLoginForm'])->name('auth.login');
44+
Route::post('/login', [LoginController::class, 'login'])->name('auth.attempt');
4445

45-
Route::get('/password/forgot', 'ForgotPasswordController@showResetRequestForm')->name('password.forgot');
46-
Route::post('/password/forgot', 'ForgotPasswordController@sendResetLinkEmail')->name('password.email');
47-
Route::get('/password/reset/{token}', 'ForgotPasswordController@showNewPassword')->name('password.reset');
46+
Route::get('/password/forgot', [ForgotPasswordController::class, 'showResetRequestForm'])->name('password.forgot');
47+
Route::post('/password/forgot', [ForgotPasswordController::class, 'sendResetLinkEmail'])->name('password.email');
48+
Route::get('/password/reset/{token}', [ForgotPasswordController::class, 'showNewPassword'])->name('password.reset');
4849
});
4950

50-
Route::namespace('Wink\Http\Controllers')
51-
->middleware([$middlewareGroup, Authenticate::class])
51+
Route::middleware([$middlewareGroup, Authenticate::class])
5252
->as('wink.')
5353
->domain(config('wink.domain'))
5454
->prefix(config('wink.path'))

0 commit comments

Comments
 (0)