user3547548
user3547548

Reputation: 72

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.

Upvotes: 0

Views: 216

Answers (1)

Marcin Nabiałek
Marcin Nabiałek

Reputation: 111839

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

Upvotes: 2

Related Questions