1

Install MessengerController for FB chatbot. I added 'Input' => Illuminate\Support\Facades\Input::class in app.php and update local server. Received the next message

ErrorException Class 'Illuminate\Support\Facades\Input' not found

Database name seems incorrect You're using the default database name laravel. This database does not exist. Edit the .env file and use the correct database name in the DB_DATABASE key.

Code in MessengerController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;


use pimax\FbBotApp;
use pimax\Messages\Message;

class MessengerController extends Controller
{
    public function webhook()
    {
        $local_verify_token = env('WEBHOOK_VERIFY_TOKEN');
        $hub_verify_token = \Input::get('hub_verify_token');

        if($local_verify_token == $hub_verify_token) {
            return \Input::get('hub_challenge');
        }

        else return "Bad verify token";
    }
}

What should fix in my code?

  • Why not use the standard `$request` injection logic? I.E. `public function webhook(Request $request){ ... }` and `$request->input('hub_verify_token')`? You've already got `use Illuminate\Http\Request;`, but you're not doing anything with that... – Tim Lewis Jun 05 '20 at 18:20
  • you can use request()->input('hub_verify_token'); – Itamar Garcia Jun 05 '20 at 18:29
  • 1
    Does this answer your question? [Class 'Illuminate\Support\Facades\Input' not found](https://stackoverflow.com/questions/58078757/class-illuminate-support-facades-input-not-found) – STA Jun 05 '20 at 18:34

0 Answers0