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

Commit

Permalink
StyleCI integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
amir9480 committed Oct 29, 2019
1 parent 30e734a commit e809ee9
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/.scrutinizer.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
/images export-ignore
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ docs
vendor
coverage
.phpunit.result.cache
coverage.clover
coverage.clover
.php_cs.cache
4 changes: 4 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
php:
preset: laravel
enabled:
- length_ordered_imports
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<h1 align="center">بلوط</h1>

![Baloot](./images/banner.jpg)

<div dir="rtl">

> پکیج لاراول مخصوص توسعه دهندگان ایرانی
<p align="center">

[![Latest Stable Version](https://poser.pugx.org/sanjabteam/baloot/v/stable)](https://packagist.org/packages/sanjabteam/baloot)
[![Total Downloads](https://poser.pugx.org/sanjabteam/baloot/downloads)](https://packagist.org/packages/sanjabteam/baloot)
[![Build Status](https://travis-ci.org/sanjabteam/baloot.svg?branch=master)](https://travis-ci.org/sanjabteam/baloot)
[![Code Style](https://github.styleci.io/repos/214197383/shield)](https://github.styleci.io/repos/214197383)
[![License](https://poser.pugx.org/sanjabteam/baloot/license)](https://packagist.org/packages/sanjabteam/baloot)

</p>

من همیشه یه سری کد داشتم که هر بار پروژه جدید ایجاد میکردم هر بار از اول کپی میکردم تو پروژه جدیده.بعد تصمیم گرفتم این رو به صورت یه پکیج در بیارم تا هم خودم و هم همکارام به راحتی بتونیم ازشون استفاده کنیم.
حالا اگه شما هم فکر میکنین این پکیج میتونه روند توسعه نرم افزار هاتون رو سریع کنه شما هم استفاده کنین. اگه فکر میکنین چیز خاصی هست که مخصوص توسعه دهنده های ایرانی هست اما در این پکیج موجود نیست حتما یه

forkو pull request

مهمون کنین :).

<p align="center">

[![Build Status](https://travis-ci.org/sanjabteam/baloot.svg?branch=master)](https://travis-ci.org/sanjabteam/baloot)
مهمون کنین 😁.

</p>

امکانات:
* ذخیره و بازیابی تاریخ شمسی در الوکوئنت
Expand Down Expand Up @@ -461,9 +468,15 @@ public function run()
</div>

سپس بعد از میگریت سید رو انجام بدین.

<div dir="ltr">

```bash
php artisan migrate --seed
```

</div>

حالا جداول شما از شهر ها و استان ها پر شده برای استفاده از دو مدل پایین میتونین استفاده کنین.

مدل استان:
Expand All @@ -477,7 +490,7 @@ php artisan migrate --seed
<div dir="ltr">

```php
use anjabHelpers\Models\City;
use Baloot\Models\City;

City::where('name', 'آمل')->first()
```
Expand All @@ -492,7 +505,7 @@ City::where('name', 'آمل')->first()

```php
use Baloot\Models\Province;
use anjabHelpers\Models\City;
use Baloot\Models\City;

Route::get('test/{province}/{city}', function (Province $province, City $city) {
abort_if($city->province_id != $province->id, 404);
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "sanjabteam/baloot",
"description": "Laravel helper package for iranians",
"keywords": [
"laravel",
"sanjabteam",
"helpers"
],
Expand All @@ -17,8 +18,8 @@
"require": {
"php": "^7.1",
"hekmatinasser/verta": "^1.10",
"illuminate/support": "^6.0",
"cviebrock/eloquent-sluggable": "^6.0"
"illuminate/support": "^6",
"cviebrock/eloquent-sluggable": "^6"
},
"require-dev": {
"orchestra/testbench": "^4.0",
Expand Down
Binary file added images/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion src/BalootFakerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,20 @@ public function aparatVideo()
if (is_array($videos)) {
return "https://www.aparat.com/v/".array_random($videos);
}
return "https://www.aparat.com/v/".array_random(["IAN6z","xrAb8","w7NMS","0fFhg","uCgQd","hK5fF","arsHC","43aZ8","syI7N","XaN3o","YJpM1","TSAz1","sQBq4","Y7AZF","dNn3M","uR7DI","TZ63C","8T3hA","NdqEn","xCFnE","mL21e","ZkGp8","MV9RW","jicTW","Ikan1","Ylj9x","3Qmhd","jWqud","6VeK8","fic92","fdQXx","UQ2jS","RrctN","EutTQ","evc7o","CugP3","1T08s","eTFxk","UF8xV","Qn8CF","xtKbg","hTWBg","wWBU7","zt90l","fjyRd","VPvu3","iaCV3","4r9IK","m1gxT","XonZx","rUC8l","6yoBO","aoE2p","slKDV","2Dun4","L4J1F","dwWTy","a6PqK","bDaPX","pRPSt"]);
return "https://www.aparat.com/v/".array_random([
"IAN6z","xrAb8","w7NMS","0fFhg","uCgQd",
"hK5fF","arsHC","43aZ8","syI7N","XaN3o",
"YJpM1","TSAz1","sQBq4","Y7AZF","dNn3M",
"uR7DI","TZ63C","8T3hA","NdqEn","xCFnE",
"mL21e","ZkGp8","MV9RW","jicTW","Ikan1",
"Ylj9x","3Qmhd","jWqud","6VeK8","fic92",
"fdQXx","UQ2jS","RrctN","EutTQ","evc7o",
"CugP3","1T08s","eTFxk","UF8xV","Qn8CF",
"xtKbg","hTWBg","wWBU7","zt90l","fjyRd",
"VPvu3","iaCV3","4r9IK","m1gxT","XonZx",
"rUC8l","6yoBO","aoE2p","slKDV","2Dun4",
"L4J1F","dwWTy","a6PqK","bDaPX","pRPSt"
]);
}

public function aparatVideos($count)
Expand Down
2 changes: 1 addition & 1 deletion src/BalootServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Baloot\Models\City;
use Baloot\Models\Province;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;

class BalootServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 1 addition & 1 deletion src/EloquentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Baloot;

use Exception;
use Hekmatinasser\Verta\Verta;
use Illuminate\Support\Arr;
use Hekmatinasser\Verta\Verta;

trait EloquentHelper
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/AparatVideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Baloot\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use Illuminate\Database\Eloquent\Model;

/**
* @property string $title عنوان ویدیو
Expand Down
2 changes: 1 addition & 1 deletion src/Models/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Baloot\Models;

use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
use Cviebrock\EloquentSluggable\Sluggable;

/**
* @property string $name name of provice
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Province.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Baloot\Models;

use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
use Cviebrock\EloquentSluggable\Sluggable;

/**
* @property string $name name of province
Expand Down
6 changes: 5 additions & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ function str_to_slug(string $string, string $separator = '-')
{
$string = trim(mb_strtolower($string));
$string = preg_replace('!['.preg_quote($separator === '-' ? '_' : '-').']+!u', $separator, $string);
return preg_replace("/\\" . $separator . "{2,}/", $separator, preg_replace('/[^A-Za-z0-9\x{0600}-\x{06FF}]/ui', $separator, $string));
return preg_replace(
"/\\" . $separator . "{2,}/",
$separator,
preg_replace('/[^A-Za-z0-9\x{0600}-\x{06FF}]/ui', $separator, $string)
);
}
}

Expand Down

0 comments on commit e809ee9

Please sign in to comment.