Skip to content

Commit

Permalink
Route not found error for Pirep::resource() call #559 (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio authored Feb 20, 2020
1 parent 0297ec3 commit cc23c32
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 174 deletions.
42 changes: 21 additions & 21 deletions app/Http/Routes/web.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
<?php

/**
* User doesn't need to be logged in for these
*/
use App\Http\Middleware\SetActiveTheme;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;

Route::group([
'namespace' => 'Frontend', 'prefix' => '', 'as' => 'frontend.',
'middleware' => [SetActiveTheme::class],
], function () {
Route::get('/', 'HomeController@index')->name('home');
Route::get('r/{id}', 'PirepController@show')->name('pirep.show.public');
Route::get('pireps/{id}', 'PirepController@show')->name('pireps.show');

Route::get('p/{id}', 'ProfileController@show')->name('profile.show.public');
Route::get('users', 'UserController@index')->name('users.index');
Route::get('pilots', 'UserController@index')->name('pilots.index');

Route::get('livemap', 'LiveMapController@index')->name('livemap.index');
});

/*
* These are only visible to a logged in user
*/
Expand All @@ -41,19 +23,37 @@
Route::get('flights/search', 'FlightController@search')->name('flights.search');
Route::resource('flights', 'FlightController');

Route::get('pireps/fares', 'PirepController@fares');
Route::post('pireps/{id}/submit', 'PirepController@submit')->name('pireps.submit');

Route::resource('pireps', 'PirepController', [
'except' => ['show'],
]);

Route::get('pireps/fares', 'PirepController@fares');
Route::post('pireps/{id}/submit', 'PirepController@submit')->name('pireps.submit');

Route::get('profile/acars', 'ProfileController@acars')->name('profile.acars');
Route::get('profile/regen_apikey', 'ProfileController@regen_apikey')->name('profile.regen_apikey');

Route::resource('profile', 'ProfileController');
});

/**
* These are publically available routes
*/
Route::group([
'namespace' => 'Frontend', 'prefix' => '', 'as' => 'frontend.',
'middleware' => [SetActiveTheme::class],
], function () {
Route::get('/', 'HomeController@index')->name('home');
Route::get('r/{id}', 'PirepController@show')->name('pirep.show.public');
Route::get('pireps/{id}', 'PirepController@show')->name('pireps.show');

Route::get('p/{id}', 'ProfileController@show')->name('profile.show.public');
Route::get('users', 'UserController@index')->name('users.index');
Route::get('pilots', 'UserController@index')->name('pilots.index');

Route::get('livemap', 'LiveMapController@index')->name('livemap.index');
});

Auth::routes(['verify' => true]);
Route::get('/logout', 'Auth\LoginController@logout')->name('logout');

Expand Down
Loading

0 comments on commit cc23c32

Please sign in to comment.