Rename EarningsController to EarningController
RENAME
app/Http/Controllers/EarningsController.php
app/Http/Controllers/EarningController.php
@@ -8,7 +8,7 @@ use App\Earning;
use Auth;
-class EarningsController extends Controller {
+class EarningController extends Controller {
public function index() {
$user = Auth::user();

MODIFY
routes/web.php
routes/web.php
@@ -11,10 +11,10 @@ Route::post('/register', 'RegisterController@store');
Route::group(['middleware' => ['auth']], function () {
Route::get('/dashboard', 'DashboardController')->name('dashboard');
- Route::get('/earnings', 'EarningsController@index')->name('earnings.index');
- Route::get('/earnings/create', 'EarningsController@create')->name('earnings.create');
- Route::post('/earnings', 'EarningsController@store');
- Route::delete('/earnings/{earning}', 'EarningsController@destroy')->middleware('can:delete,earning');
+ Route::get('/earnings', 'EarningController@index')->name('earnings.index');
+ Route::get('/earnings/create', 'EarningController@create')->name('earnings.create');
+ Route::post('/earnings', 'EarningController@store');
+ Route::delete('/earnings/{earning}', 'EarningController@destroy')->middleware('can:delete,earning');
Route::get('/spendings', 'SpendingsController@index')->name('spendings.index');
Route::get('/spendings/create', 'SpendingsController@create')->name('spendings.create');

Rename EarningsController to EarningController