mercredi 30 mars 2016

Call to undefined method App\Http\Controllers\SubscriptionController::getMiddleware()

I am calling the \prelaunchroute in my application and this is how it is defined in my routes.php:

Route::get('/prelaunch', [ 'uses' => 'SubscriptionController@getReferrer', 'as' => 'subscriber.referral'], function () { return view('prelaunch'); });

But unfortunately, I am getting: Call to undefined method App\Http\Controllers\SubscriptionController::getMiddleware()

This is a draft of my SubscriptionController code:

namespace App\Http\Controllers;

use App\Http\Manager\SubscriptionManager;
use Illuminate\Support\Facades\Request;


/**
 * Class SubscriptionController
 * @package App\Http\Controllers
 */
class SubscriptionController
{
    /**
     * @var \SubscriptionManager $subscriptionManager
     */
    protected $subscriptionManager;

    /**
     * SubscriptionController constructor.
     */
    //public function __construct(SubscriptionManager $subscriptionManager)
    public function __construct(SubscriptionManager $subscriptionManager)
    {
        $this->subscriptionManager = $subscriptionManager;
    }

    /**
     * @param Request $request
     * @return void
     */
    public function subscribe(Request $request)
    {
        $this->subscriptionManager->subscribeToList($request);
    }

    /**
     * @param Request $request
     * @return void
     */
    public function unsubscribe(Request $request)
    {
        $this->subscriptionManager->unsubscribeFromList($request);
    }

    /**
     * @return void
     */
    public function getReferrer()
    {
        print_r(Input::all());
        die;
        $utm_source = \Input::get('utm_source');


        return view('prelaunch');
    }
}

Any thoughts on this one? Please bare in mind that I am fairly new to Laravel.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire