1

This is not the usual "cannot find driver" error message with Laravel. I am able to successfully create migrations and see them reflected in the database. However when I attempt to insert or select, i get the following error:

 QueryException in Connection.php line 647:
could not find driver (SQL: insert into .....

this is from my migration file:

public function up()
    {
        Schema::create('vendors', function (Blueprint $table) {
             $table->increments('id');
            $table->string('vendor_name');
            $table->string('contact_name');
            $table->string('phone_number');
            $table->string('alt_phone_number');P
            $table->string('email')->unique();
            $table->string('address');
            $table->timestamps();
        });
    }

and this is from my store() method in my RESTful Model:

public function store(Request $request)
    {
        //
        Vendor::create(request(['vendor_name', 'contact_name', 'phone_number', 'alt_phone_number', 'email','address']));
        this.index();
    }

I know the request is getting the data, as I am about to do a dd() and view the contents perfectly fine.

Jacob Alley
  • 767
  • 8
  • 34

1 Answers1

0

This worked for me:
For PDOException: could not find driver for MySQL, and if it is Debian based OS,

sudo apt-get -y install php5-mysql
Md.Jewel Mia
  • 3,345
  • 3
  • 19
  • 24