Skip to content

Commit 4b5d06e

Browse files
committed
updated readme
1 parent 4c921df commit 4b5d06e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,37 @@ php artisan starter-kit:publish --force
144144

145145
If you have problem with laravel mix, `/vendor/xmen/starter-kit/package-sample.json` could help you. BTW **don't forget to have got backup form you `package.json`**
146146

147+
148+
## Add persian jdate & fix pagination
149+
150+
```php
151+
// top of file
152+
use Xmen\StarterKit\Helpers\TDate;
153+
154+
// in the boot function
155+
public function boot()
156+
{
157+
//
158+
Carbon::setLocale('fa_IR');
159+
160+
Carbon::macro('jdate', function ($format, $tr_num = 'fa') {
161+
$dt = new TDate();
162+
return $dt->PDate($format,self::this()->timestamp);
163+
});
164+
165+
Paginator::useBootstrap();
166+
}
167+
168+
```
169+
170+
### useage persion date
171+
172+
Then you can use your custom format like this everywhere.
173+
174+
```php
175+
$user->created_at->jdate('Y/m/d');
176+
```
177+
147178
## Testing
148179

149180
``` bash

0 commit comments

Comments
 (0)