So while learning Laravel 5, I've experienced the following problem.
I've created the new controller named ContactController in the folder:
app/Http/Controllers/Pages/ContactController.php
and I have the following code in it:
<?php
namespace App\Http\Controllers\Pages;
use App\Http\Controllers\Controller;
class ContactController extends Controller {
public function index() {
return 'This is the Contact page.';
}
public function getMyDetails() {
return 'This is the My Details page.';
}
}
and I also added the following code into my web routes:
routes/web.php
Route::resource('contact', 'Pages\ContactController');
According to what I understood, it should automatically show me the message "This is the My Details page." when I open the URL address: http://laravel.devpeaks.com/public/contact/my-details. Instead I get the error:
BadMethodCallException in compiled.php line 6271:
Method controller does not exist.