From f6b8a1e9d02ebeacf4119ee9bb0730e1b0b9656a Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Sat, 20 Jul 2013 02:12:10 -0300 Subject: [PATCH] Adding doc about usage of Ardent outside of Laravel The feature was finalized in commit ff41aae, but never documented. This addition closes #60. --- README.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6a8f9c4..b27bc08 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Based on the Aware bundle for Laravel 3 by Colby Rabideau. Copyright (C) 2013 Max Ehsan <[http://laravelbook.com/](http://laravelbook.com/)> -##Installation +## Installation Add `laravelbook/ardent` as a requirement to `composer.json`: @@ -20,6 +20,25 @@ Add `laravelbook/ardent` as a requirement to `composer.json`: Update your packages with `composer update` or install with `composer install`. +### Usage outside of Laravel (since [ff41aae](https://github.com/laravelbook/ardent/commit/ff41aae645e38f21c0b5b9ee542a66ecc25f06a0)) + +If you're willing to use Ardent as a standalone ORM package you're invited to do so by using the +following configuration line in your project's boot/startup file (changing the properties according +to your database, obviously): + +```php +\LaravelBook\Ardent\Ardent::configureAsExternal(array( + 'driver' => 'mysql', + 'host' => 'localhost', + 'port' => 3306, + 'database' => 'my_system', + 'username' => 'myself', + 'password' => 'h4ckr', + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci' +)); +``` + ## Documentation * [Introduction](#intro) @@ -319,4 +338,4 @@ class User extends Ardent { } ``` -Ardent will automatically replace the plain-text password attribute with secure hash checksum and save it to database. It uses the Laravel `Hash::make()` method internally to generate hash. \ No newline at end of file +Ardent will automatically replace the plain-text password attribute with secure hash checksum and save it to database. It uses the Laravel `Hash::make()` method internally to generate hash.