We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 408333d commit 3a22825Copy full SHA for 3a22825
README.md
@@ -1 +1,34 @@
1
-# laravel-utils
+# Laravel Utils
2
+
3
+This repository contains a collection of useful classes and traits for Laravel.
4
5
+It is used mainly for [illegal studio](https://github.com/illegalstudio) projects.
6
7
+## HasPrefix
8
9
+This traits can be used to add a prefix to your model's table name.
10
11
+```php
12
+class MyModel extends Model
13
+{
14
+ use HasPrefix;
15
16
+ protected $prefix = 'my_prefix_';
17
+}
18
+```
19
20
+Alternatively you can use the `getPrefix` method to set the prefix.
21
22
+This is useful if you want to set the prefix dynamically.
23
24
25
26
27
28
29
+ public function getPrefix()
30
+ {
31
+ return config('my.prefix');
32
+ }
33
34
0 commit comments