What does “Method [show] does not exist” mean?

I am new to Laravel 4 and trying to figure out why I get an error message that the [show] method does not exist.

I don’t have a method called "show" and I can only imagine that this is a Laravel internal method, but I don’t know how to influence this or what could do it. Any thoughts or help on this would be incredibly appreciated since I was stuck with this for two days and cannot understand what I'm doing wrong.

View:

<li><a href="{{ URL::route('account-sign-in') }}">Sign in</a></li>

Route:

/*Sign In (GET)*/
    Route::get('/account/sign-in', array(
        'as'    => 'account-sign-in',
        'uses'  => 'AccountController@getSignIn'
    ));

AccountController:

class AccountController extends BaseController { 
  public function getSignIn(){ 
    return View::make('user.signIn'); 
  } 

  public function postSignIn(){ 
    $validator = Validator::make(Input::all(), array( 'email' => 'required|email', 'password' => 'required' ) ); 
    if($validator->fails()){ /*Redirect to the sign in page*/ 
      return Redirect::route('account-sign-in') ->withErrors($validator) ->withInput();
    } 
    else { /*Attempt user sign in*/ 
      $remember = (Input::has('remember')) ? true : false;
      $auth = Auth::attempt(array( 'email' => Input::get('email'), 'password' => Input::get('password'), 'active' => 1 ), $remember); 
      if($auth){ 
        /*Redirect to the intended page*/ return Redirect::intended('/'); 
      } 
      else {
        return Redirect::route('account-sign-in')->with('global', 'Email/password wrong, or account not activated.'); 
      } 
    } 
    return Redirect::route('account-sign-in') ->with('global', 'There was a problem signing you in.'); 
  } 
}
+4
source share
3 answers

What does “show [not exist]” mean?

, , show(). BaseController, BaseController, BaseController Controller, BaseController ( ):

class BaseController extends Controller {

   /**
    * Setup the layout used by the controller.
    *
    * @return void
    */
    protected function setupLayout()
    {
        if ( ! is_null($this->layout))
        {
            $this->layout = View::make($this->layout);
        }
    }
}

:

class AccountController extends BaseController {

    // Define all of your methods
    // including show() if you are using it

}
+1

, AccountController

, class AccountController extends BasesController {

BasesController BaseController

+1

. ( ) , routes.php.

Route::resource('scheduler', 'SchedulerController');
Route::get('scheduler/notices', 'SchedulerController@notices');
+1

Source: https://habr.com/ru/post/1532061/


All Articles