Ad

How To Create Sqlite File In Laravel 5.2 Framework?

I want to create an Sqlite file manually whenever user registered. I use

new SQLite3($file_path)

But Laravel keep tell me

Class 'App\Http\Controllers\Sqlite3' not found

Please help me with this. Thank very very much for the help.

Ad

Answer

You should use:

new \SQLite3($file_path)

or put

use SqlLite3;

below

namespace App\Http\Controllers;

Now you are trying to use SqLite3 from current namespace.

You might be also interested in looking at How to use objects from other namespaces and how to import namespaces in PHP

Ad
source: stackoverflow.com
Ad