Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 29f9ad1

Browse files
committed
Adding doc about usage of Ardent outside of Laravel
The feature was finalized in commit ff41aae, but never documented. This addition closes #60.
1 parent e8e33eb commit 29f9ad1

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Based on the Aware bundle for Laravel 3 by Colby Rabideau.
66

77
Copyright (C) 2013 Max Ehsan <[http://laravelbook.com/](http://laravelbook.com/)>
88

9-
##Installation
9+
## Installation
1010

1111
Add `laravelbook/ardent` as a requirement to `composer.json`:
1212

@@ -20,6 +20,25 @@ Add `laravelbook/ardent` as a requirement to `composer.json`:
2020

2121
Update your packages with `composer update` or install with `composer install`.
2222

23+
### Usage outside of Laravel (since [ff41aae](https://github.com/laravelbook/ardent/commit/ff41aae645e38f21c0b5b9ee542a66ecc25f06a0))
24+
25+
If you're willing to use Ardent as a standalone ORM package you're invited to do so by using the
26+
following configuration line in your project's boot/startup file (changing the properties according
27+
to your database, obviously):
28+
29+
```php
30+
\LaravelBook\Ardent\Ardent::configureAsExternal(array(
31+
'driver' => 'mysql',
32+
'host' => 'localhost',
33+
'port' => 3306,
34+
'database' => 'my_system',
35+
'username' => 'myself',
36+
'password' => 'h4ckr',
37+
'charset' => 'utf8',
38+
'collation' => 'utf8_unicode_ci'
39+
));
40+
```
41+
2342
## Documentation
2443

2544
* [Introduction](#intro)
@@ -319,4 +338,4 @@ class User extends Ardent {
319338
}
320339
```
321340

322-
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.
341+
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.

0 commit comments

Comments
 (0)