Skip to content

Commit 767245e

Browse files
authored
Update README.md
1 parent bc41e53 commit 767245e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ You are free to place it anywhere else, just change the namespace accordingly.
1111
## Usage
1212

1313
*This example is for a default Laravel (5.4) Model within the "App" namespace.*
14+
1415
You need an (ideally unsigned) integer field in your database which will store the properties.
1516
The length does depend on the number of values you would like to store. You only need one bit per value, so it's 8 values for each byte, if the column is unsigned.
17+
1618
Examples (based on laravel migrations):
1719
```php
1820
$table->tinyInteger('status'); // 1 byte -> maximum of 7 different values
@@ -28,6 +30,7 @@ There are only a few use-cases, but you can add as many fields as you like.
2830
Include the Trait in your model like this:
2931
```php
3032
<?php namespace App;
33+
3134
use App\Traits\BitwiseFlagTrait;
3235

3336
class Message extends Model

0 commit comments

Comments
 (0)