Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Propaganistas committed May 8, 2023
1 parent d29dff7 commit 7987f3b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ Simply import the `RoutesWithFakeIds` trait into your model:
use Illuminate\Database\Eloquent\Model;
use Propaganistas\LaravelFakeId\RoutesWithFakeIds;
class MyModel extends Model {
use RoutesWithFakeIds;
class MyModel extends Model
{
use RoutesWithFakeIds;
}
```
All routes generated for this particular model will expose a **fake** ID instead of the raw primary key. Moreover incoming requests containing those fake IDs are automatically converted back to a real ID. The obfuscation layer is therefore transparent and doesn't require you to rethink everything. Just use Laravel as you normally would.


### Example ###
Assuming an `Article` model having a named `show` route.

Expand All @@ -56,8 +54,9 @@ Route::get('articles/{article}', 'ArticleController@show')->name('articles.show'
use Illuminate\Database\Eloquent\Model;
use Propaganistas\LaravelFakeId\RoutesWithFakeIds;
class Article extends Model {
use RoutesWithFakeIds;
class Article extends Model
{
use RoutesWithFakeIds;
}
```

Expand Down

0 comments on commit 7987f3b

Please sign in to comment.