INSTALL A STANDALONE ILLUMINATE/DATABASE SETUP ============================================== Install Composer ---------------- (i) Go to https://getcomposer.org/download/ and find composer's installation instructions: php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" (ii) Add an initially empty composer.json file: { "require": { } } (iii) Initialize your project (load package list): composer intall Intall Eloquent ORM ------------------- Add the package illuminate/database to your vendor. > composer require illuminate/database Use Eloquent ------------ Now you can use Eloquent's classes outside laravel. (See https://laracasts.com/lessons/how-to-use-eloquent-outside-of-laravel) addConnection([ 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'database', 'username' => 'root', 'password' => 'password', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ]); $capsule->setAsGlobal(); $capsule->bootEloquent(); $capsule->connection()->table('users')->where('id', 1)->first(); ?> Create a new Model ------------------ Like this: create('histograms', function($table) { $table->increments('id'); $table->string('filename',256); $table->string('data',512); // Add created_at and updated_at columns $table->timestamps(); // Add index $table->index('filename'); } ); ?> Run your schema and create a table ---------------------------------- Just run your schema: > php Schema_Histogram.php This creates the table specified by the Schema. Insert new records ------------------ This creates a new table record: 'test.png', 'data' => '[ null ]'] ); ?> Fetch records form the database ------------------------------- Use the model's WHERE function to select some rows. '1'] )->first()->toArray(); ?>