I'm trying to write a script for laravel that queries my database and fetches tables, but I'm not sure what to include in the file in order to get the DB class to work.
Thus far my code looks like:
$tables = DB::query("SHOW TABLES"); foreach ($tables as $table) { print $table . "\n"; }
I've tried using require "../../vendor/autoload.php" but that doesn't help.
So for instance, the DB class works fine if I call it within a controller, but not if I create a directory, say /application/scripts and create a file test.php . If I try to call DB in that file, the DB class isn't defined (for good reason). I'm wondering what I need to require in that file in order for that class to be defined.
$dbin your example is not defined... you need to include more information that you have done for people to assist without to many "guesses"