Package Data | |
---|---|
Maintainer Username: | sumit_2803 |
Maintainer Contact: | sgpatil.2803@gmail.com (Sumit Patil) |
Package Create Date: | 2014-10-29 |
Package Last Update: | 2016-03-08 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-11 15:11:53 |
Package Statistics | |
---|---|
Total Downloads: | 111 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 11 |
Total Watchers: | 5 |
Total Forks: | 3 |
Total Open Issues: | 1 |
Orientdb Graph Eloquent Driver for Laravel 4
Looking for Orientdb Driver for Laravel 5
Add the package to your composer.json
and run composer update
.
{
"require": {
"sgpatil/orientdb": "@dev"
}
}
Add the service provider in app/config/app.php
:
'Sgpatil\Orientdb\OrientdbServiceProvider',
This will register all the required classes for this package.
Open app/config/database.php
make orientdb
your default connection:
'default' => 'orientdb',
Add the connection defaults:
'connections' => [
'orientdb' => [
'driver' => 'orientdb',
'host' => 'localhost',
'port' => '2480',
'database' => 'database_name',
'username' => 'root',
'password' => 'root'
]
]
Add your database username and password in 'username' and 'password' field. In 'database_name' add name of orientdb database which you want to connect and use.
To create a migration, you may use the orient command on the Artisan CLI:
php artisan orient:make create_users_table
The migration will be placed in your database/migrations folder, and will contain a timestamp which allows the framework to determine the order of the migrations.
The --table and --create options may also be used to indicate the name of the table, and whether the migration will be creating a new table:
php artisan orient:make add_votes_to_users_table --table=users_votes
php artisan orient:make create_users_table --create=users
To run migration
php artisan orient
class User extends Orientdb {
protected $fillable = ['name', 'email'];
}
$user = User::create(['name' => 'Some Name', 'email' => 'some@email.com']);
You can use this by extending Orientdb into model class.