Browse Source

Yet another quality commit.

pull/2/head
Mohammad Akbari 4 years ago
parent
commit
5866521e83
Signed by: akbarjimi GPG Key ID: 55726AEFECE5E683
  1. 6
      app/Models/Activity.php
  2. 2
      app/Models/Business.php
  3. 2
      app/Models/Cost.php
  4. 2
      app/Models/File.php
  5. 2
      app/Models/Fingerprint.php
  6. 2
      app/Models/Project.php
  7. 2
      app/Models/SoftDeletes.php
  8. 2
      app/Models/Sprint.php
  9. 2
      app/Models/Status.php
  10. 2
      app/Models/System.php
  11. 2
      app/Models/Tag.php
  12. 4
      app/Models/TagTask.php
  13. 2
      app/Models/Transaction.php
  14. 2
      app/Models/User.php
  15. 2
      app/Models/Workflow.php
  16. 18
      app/Scopes/BusinessScope.php
  17. 8
      app/Statists/Pipe.php
  18. 44
      app/Statists/SprintStatist.php
  19. 22
      app/Statists/SystemStatist.php
  20. 54
      app/Statists/TagStatist.php
  21. 2
      app/Utilities/Exceptions/Handler.php
  22. 42
      app/Utilities/Jobs/AsyncCall.php
  23. 2
      app/Utilities/Logger/CreateCustomLogger.php
  24. 2
      app/Utilities/Logger/LogServiceRecordProcessor.php
  25. 23
      app/Utilities/Middlewares/BindBusinessInfo.php
  26. 2
      app/Utilities/Models/Model.php
  27. 2
      app/Utilities/Models/ReportableRelation.php
  28. 55
      app/Utilities/Providers/AuthServiceProvider.php
  29. 2
      app/Utilities/Providers/HiLibraryServiceProvider.php
  30. 32
      composer.json
  31. 259
      composer.lock
  32. 232
      config.default/app.php
  33. 72
      config.default/filesystems.php
  34. 104
      config.default/logging.php
  35. 33
      config.default/services.php
  36. 73
      config/amqp.php
  37. 93
      config/app.php
  38. 0
      config/auth.php
  39. 0
      config/broadcasting.php
  40. 0
      config/cache.php
  41. 43
      config/cors.php
  42. 59
      config/cors.php.laravel
  43. 0
      config/cors.php.lumen
  44. 0
      config/database.php
  45. 0
      config/hashing.php
  46. 2
      config/logging.php
  47. 0
      config/mail.php
  48. 0
      config/queue.php
  49. 0
      config/session.php
  50. 0
      config/view.php
  51. 152
      definitions.json
  52. 24
      docker-compose.yml
  53. 16
      routes/api.php

6
app/Models/Activity.php

@ -1,10 +1,10 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\RemoteModel;
use Illuminate\Database\Eloquent\Model;
class Activity extends RemoteModel
class Activity extends Model
{ {
} }

2
app/Models/Business.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\File; use App\File;
use App\SoftDeletes; use App\SoftDeletes;

2
app/Models/Cost.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;

2
app/Models/File.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;

2
app/Models/Fingerprint.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;

2
app/Models/Project.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\File; use App\File;
use App\SoftDeletes; use App\SoftDeletes;

2
app/Models/SoftDeletes.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes as SoftDeletesOriginal; use Illuminate\Database\Eloquent\SoftDeletes as SoftDeletesOriginal;

2
app/Models/Sprint.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;

2
app/Models/Status.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;

2
app/Models/System.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;

2
app/Models/Tag.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;

4
app/Models/TagTask.php

@ -1,8 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;

2
app/Models/Transaction.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;
use App\Utilities\Zarinpal\Laravel\Facade\Zarinpal; use App\Utilities\Zarinpal\Laravel\Facade\Zarinpal;

2
app/Models/User.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\File; use App\File;
use App\SoftDeletes; use App\SoftDeletes;

2
app/Models/Workflow.php

@ -1,6 +1,6 @@
<?php <?php
namespace App;
namespace App\Models;
use App\HiLib\Models\Model; use App\HiLib\Models\Model;
use App\Scopes\BusinessScope; use App\Scopes\BusinessScope;

18
app/Scopes/BusinessScope.php

@ -1,18 +0,0 @@
<?php
namespace App\Scopes;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
class BusinessScope implements Scope
{
public function apply(Builder $builder, Model $model)
{
$builder->where('business_id', '=', request('business_id'));
}
}

8
app/Statists/Pipe.php

@ -1,8 +0,0 @@
<?php
namespace App\Statists;
interface Pipe
{
public function handle(&$content, \Closure $next);
}

44
app/Statists/SprintStatist.php

@ -1,44 +0,0 @@
<?php
namespace App\Statists;
use App\Task;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Cache;
class SprintStatist implements Pipe
{
private Task $task;
public function __construct($task)
{
$this->task = $task;
}
public function handle(&$result, $next)
{
$key = 'sprints.';
$key .= ($this->task->sprint_id ?? 0).'.';
$key .= ($this->task->assignee_id ?? 0).'.';
$key .= $this->task->workflow_id . '.';
$key .= $this->task->status_id;
$map = [
'total' => 0,
'test' => 0,
'overdue' => 0,
'worked' => 0, // total worked in minute
'estimate' => 0, // estimate total
];
$node = Arr::get($result, $key, $map);
$node['total'] = $node['total'] + 1;
$node['test'] = $node['test'] + $result->ready_to_test;
$node['overdue'] = $node['overdue'] + ($result->on_time? 0 : 1);
Arr::set($result, $key, $node);
return $next($result);
}
}

22
app/Statists/SystemStatist.php

@ -1,22 +0,0 @@
<?php
namespace App\Statists;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Cache;
class SystemStatist implements Pipe
{
public function handle($tasks, $next)
{
$key = 'systems.'. ($task->system_id ?? 0) . '.' . ($task->assignee_id ?? 0) .
'.' . $task->workflow_id . '.' . $task->status_id;
$node = Arr::get($result, $key, ['total' => 0, 'test' => 0, 'overdue' => 0]);
$node['total'] = $node['total'] + 1;
$node['test'] = $node['test'] + $task->ready_to_test;
$node['overdue'] = $node['overdue'] + ($task->on_time? 0: 1);
Arr::set($result, $key, $node);
return $next($tasks);
}
}

54
app/Statists/TagStatist.php

@ -1,54 +0,0 @@
<?php
namespace App\Statists;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Cache;
class TagStatist implements Pipe
{
public function handle($tasks, $next)
{
$result = [];
$project = $tasks->first()->project_id;
$tags = $tasks->pluck('tag_id');
$users = $tasks->pluck('assignee_id');
$workflows = $tasks->pluck('workflow_id');
$statuses = $tasks->pluck('status_id');
foreach ($tags as $tag) {
foreach ($users as $user) {
foreach ($workflows as $workflow) {
foreach ($statuses as $status) {
$filter = $tasks
->where('sprint_id', '=', $tag)
->where('assignee_id', '=', $user)
->where('workflow_id', '=', $workflow)
->where('status_id', '=', $status);
if ($filter->isEmpty()) {
continue;
}
$stat = [
'task_count' => $filter->count(),
'total_worked_in_minute' => $filter->sum('spent_time'),
'overdue_count' => $filter->where('on_time','=',false)->count(),
'total_estimate_in_minute' => $filter->sum('estimated_time'),
'test_flag_count' => $filter->where('ready_to_test', '=', true)->count(),
];
Arr::set($result,"{$tag}.{$user}.{$workflow}.{$status}",$stat);
}
}
}
}
Cache::put($project, $result);
return $next($tasks);
}
}

2
app/Utilities/Exceptions/Handler.php

@ -1,6 +1,6 @@
<?php <?php
namespace App\HiLib\Exceptions;
namespace App\Utilities\Exceptions;
use Throwable; use Throwable;
use ReflectionClass; use ReflectionClass;

42
app/Utilities/Jobs/AsyncCall.php

@ -1 +1,41 @@
<?php namespace App\HiLib\Jobs; use App\Jobs\Job; class AsyncCall extends Job { private string $method; private string $service; private string $path; private array $data; /** * AsyncCall constructor. * @param string $method * @param string $service * @param string $path * @param array $data * @param string $queue */ public function __construct(string $method, string $service, string $path, array $data, string $queue) { $this->method = $method; $this->service = $service; $this->path = $path; $this->data = $data; $this->onQueue($queue); $this->onConnection('database'); } /** * Execute the job. * * @return void */ public function handle() { call($this->method, $this->service, $this->path, $this->data); } }
<?php
namespace App\Utilities\Jobs;
use App\Jobs\Job;
class AsyncCall extends Job
{
private string $method;
private string $service;
private string $path;
private array $data;
/**
* AsyncCall constructor.
* @param string $method
* @param string $service
* @param string $path
* @param array $data
* @param string $queue
*/
public function __construct(string $method, string $service, string $path, array $data, string $queue)
{
$this->method = $method;
$this->service = $service;
$this->path = $path;
$this->data = $data;
$this->onQueue($queue);
$this->onConnection('database');
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
call($this->method, $this->service, $this->path, $this->data);
}
}

2
app/Utilities/Logger/CreateCustomLogger.php

@ -1,6 +1,6 @@
<?php <?php
namespace App\HiLib\Logger;
namespace App\Utilities\Logger;
use DateTimeZone; use DateTimeZone;
use InvalidArgumentException; use InvalidArgumentException;

2
app/Utilities/Logger/LogServiceRecordProcessor.php

@ -1,6 +1,6 @@
<?php <?php
namespace App\HiLib\Logger;
namespace App\Utilities\Logger;
use Throwable; use Throwable;
use Carbon\Carbon; use Carbon\Carbon;

23
app/Utilities/Middlewares/BindBusinessInfo.php

@ -1 +1,22 @@
<?php namespace App\HiLib\Middlewares; use Closure; class BindBusinessInfo { public function handle($request, Closure $next, $guard = null) { $business_id = $request->has('business_id') ? $request->business_id : $request->route('business'); $businessInfo = env('CONTAINER_NAME') == 'hi-user-app' ? \App\Business::info($business_id) : get('user', env('USER_URL') . 'actions/businesses/' . $business_id . '/info', []); $request->merge(['_business_info' => $businessInfo]); return $next($request); } }
<?php
namespace App\Utilities\Middlewares;
use Closure;
class BindBusinessInfo
{
public function handle($request, Closure $next, $guard = null)
{
$business_id = $request->has('business_id') ? $request->business_id : $request->route('business');
$businessInfo = env('CONTAINER_NAME') == 'hi-user-app' ?
\App\Business::info($business_id) :
get('user', env('USER_URL') . 'actions/businesses/' . $business_id . '/info', []);
$request->merge(['_business_info' => $businessInfo]);
return $next($request);
}
}

2
app/Utilities/Models/Model.php

@ -1,6 +1,6 @@
<?php <?php
namespace App\HiLib\Models;
namespace App\Utilities\Models;
use Anik\Amqp\Exchange; use Anik\Amqp\Exchange;
use Anik\Amqp\Facades\Amqp; use Anik\Amqp\Facades\Amqp;

2
app/Utilities/Models/ReportableRelation.php

@ -1,6 +1,6 @@
<?php <?php
namespace App\HiLib\Models;
namespace App\Utilities\Models;
use Anik\Amqp\Exchange; use Anik\Amqp\Exchange;
use Anik\Amqp\Facades\Amqp; use Anik\Amqp\Facades\Amqp;

55
app/Utilities/Providers/AuthServiceProvider.php

@ -1 +1,54 @@
<?php namespace App\HiLib\Providers; use App\User; use Illuminate\Http\Request; use Illuminate\Support\Arr; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Http; use Illuminate\Support\ServiceProvider; class AuthServiceProvider extends ServiceProvider { public function boot() { $this->app['auth']->viaRequest('api', function (Request $request) { // with token if ($request->bearerToken()) { return $this->loginUserWithToken($request); } // first party if ($request->getHost() === $container_name = getenv('CONTAINER_NAME')) { return $this->loginServiceWithSetUser($container_name); } // without token return null; }); } public function loginUserWithToken(Request $request): User { $attributes = Http::retry(3, 100) ->withToken($request->bearerToken()) ->get(env('USER_URL') . 'auth') ->json(); $attributes = Arr::get($attributes, 'data',[]); // dd($attributes); return new User($attributes); } public function loginServiceWithSetUser(string $container_name): User { Auth::setUser($user = new User([ 'name' => $container_name, 'is_service' => true, ])); return $user; } }
<?php
namespace App\Utilities\Providers;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
public function boot()
{
$this->app['auth']->viaRequest('api', function (Request $request) {
// with token
if ($request->bearerToken()) {
return $this->loginUserWithToken($request);
}
// first party
if ($request->getHost() === $container_name = getenv('CONTAINER_NAME')) {
return $this->loginServiceWithSetUser($container_name);
}
// without token
return null;
});
}
public function loginUserWithToken(Request $request): User
{
$attributes = Http::retry(3, 100)
->withToken($request->bearerToken())
->get(env('USER_URL') . 'auth')
->json();
$attributes = Arr::get($attributes, 'data',[]);
// dd($attributes);
return new User($attributes);
}
public function loginServiceWithSetUser(string $container_name): User
{
Auth::setUser($user = new User([
'name' => $container_name,
'is_service' => true,
]));
return $user;
}
}

2
app/Utilities/Providers/HiLibraryServiceProvider.php

@ -1,6 +1,6 @@
<?php <?php
namespace App\HiLib\Providers;
namespace App\Utilities\Providers;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Stringable; use Illuminate\Support\Stringable;

32
composer.json

@ -8,28 +8,27 @@
], ],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^7.3|^8.0",
"ext-gd": "*", "ext-gd": "*",
"ext-json": "*", "ext-json": "*",
"php": "^7.3|^8.0",
"anik/amqp": "^1.3", "anik/amqp": "^1.3",
"illuminate/notifications": "^8.0",
"torann/geoip": "^3.0",
"spatie/image": "^1.0",
"morilog/jalali": "3.*",
"laravel/tinker": "^2.5",
"fideloper/proxy": "^4.4",
"jenssegers/agent": "^2.6", "jenssegers/agent": "^2.6",
"laravel/socialite": "^5.1",
"laravel/framework": "^8.12",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/legacy-factories": "^1", "laravel/legacy-factories": "^1",
"fruitcake/laravel-cors": "^2.0",
"laravel/lumen-framework": "^8.0", "laravel/lumen-framework": "^8.0",
"laravel/socialite": "^5.1",
"illuminate/notifications": "^8.0",
"league/flysystem-aws-s3-v3": "~1.0", "league/flysystem-aws-s3-v3": "~1.0",
"league/flysystem-cached-adapter": "~1.0",
"morilog/jalali": "3.*",
"spatie/image": "^1.0",
"spatie/laravel-medialibrary": "^8.0",
"spatie/laravel-medialibrary": "^9.0",
"spatie/laravel-query-builder": "^3.3", "spatie/laravel-query-builder": "^3.3",
"torann/geoip": "^3.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.12",
"laravel/tinker": "^2.5",
"spatie/laravel-query-builder": "^3.3"
"league/flysystem-cached-adapter": "~1.0"
}, },
"require-dev": { "require-dev": {
"facade/ignition": "^2.5", "facade/ignition": "^2.5",
@ -54,7 +53,10 @@
"App\\": "app/", "App\\": "app/",
"Database\\Factories\\": "database/factories/", "Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/" "Database\\Seeders\\": "database/seeders/"
}
},
"files": [
"app/Utilities/Helpers/index.php"
]
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {

259
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "727372edb248a9d83eed7a324b8eda99",
"content-hash": "f9d97bc77997badf02ebb4ff03402453",
"packages": [ "packages": [
{ {
"name": "anik/amqp", "name": "anik/amqp",
@ -2992,142 +2992,25 @@
}, },
"time": "2020-11-07T02:01:34+00:00" "time": "2020-11-07T02:01:34+00:00"
}, },
{
"name": "paragonie/constant_time_encoding",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/paragonie/constant_time_encoding.git",
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
"shasum": ""
},
"require": {
"php": "^7|^8"
},
"require-dev": {
"phpunit/phpunit": "^6|^7|^8|^9",
"vimeo/psalm": "^1|^2|^3|^4"
},
"type": "library",
"autoload": {
"psr-4": {
"ParagonIE\\ConstantTime\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com",
"role": "Maintainer"
},
{
"name": "Steve 'Sc00bz' Thomas",
"email": "steve@tobtu.com",
"homepage": "https://www.tobtu.com",
"role": "Original Developer"
}
],
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
"keywords": [
"base16",
"base32",
"base32_decode",
"base32_encode",
"base64",
"base64_decode",
"base64_encode",
"bin2hex",
"encoding",
"hex",
"hex2bin",
"rfc4648"
],
"support": {
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
"source": "https://github.com/paragonie/constant_time_encoding"
},
"time": "2020-12-06T15:14:20+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v9.99.100",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
"shasum": ""
},
"require": {
"php": ">= 7"
},
"require-dev": {
"phpunit/phpunit": "4.*|5.*",
"vimeo/psalm": "^1"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"csprng",
"polyfill",
"pseudorandom",
"random"
],
"support": {
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/random_compat/issues",
"source": "https://github.com/paragonie/random_compat"
},
"time": "2020-10-15T08:29:30+00:00"
},
{ {
"name": "php-amqplib/php-amqplib", "name": "php-amqplib/php-amqplib",
"version": "v2.12.3",
"version": "v2.12.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-amqplib/php-amqplib.git", "url": "https://github.com/php-amqplib/php-amqplib.git",
"reference": "f746eb44df6d8f838173729867dd1d20b0265faa"
"reference": "0eaaa9d5d45335f4342f69603288883388c2fe21"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/f746eb44df6d8f838173729867dd1d20b0265faa",
"reference": "f746eb44df6d8f838173729867dd1d20b0265faa",
"url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/0eaaa9d5d45335f4342f69603288883388c2fe21",
"reference": "0eaaa9d5d45335f4342f69603288883388c2fe21",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-sockets": "*", "ext-sockets": "*",
"php": ">=5.6.3,<8.0",
"phpseclib/phpseclib": "^2.0|^3.0"
"php": ">=5.6.3",
"phpseclib/phpseclib": "^2.0.0"
}, },
"conflict": { "conflict": {
"php": "7.4.0 - 7.4.1" "php": "7.4.0 - 7.4.1"
@ -3139,7 +3022,7 @@
"ext-curl": "*", "ext-curl": "*",
"nategood/httpful": "^0.2.20", "nategood/httpful": "^0.2.20",
"phpunit/phpunit": "^5.7|^6.5|^7.0", "phpunit/phpunit": "^5.7|^6.5|^7.0",
"squizlabs/php_codesniffer": "^3.5"
"squizlabs/php_codesniffer": "^2.5"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -3186,9 +3069,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-amqplib/php-amqplib/issues", "issues": "https://github.com/php-amqplib/php-amqplib/issues",
"source": "https://github.com/php-amqplib/php-amqplib/tree/v2.12.3"
"source": "https://github.com/php-amqplib/php-amqplib/tree/v2.12.1"
}, },
"time": "2021-03-01T12:21:31+00:00"
"time": "2020-09-25T18:34:58+00:00"
}, },
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
@ -3261,26 +3144,24 @@
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",
"version": "3.0.5",
"version": "2.0.30",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpseclib/phpseclib.git", "url": "https://github.com/phpseclib/phpseclib.git",
"reference": "7c751ea006577e4c2e83326d90c8b1e8c11b8ede"
"reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/7c751ea006577e4c2e83326d90c8b1e8c11b8ede",
"reference": "7c751ea006577e4c2e83326d90c8b1e8c11b8ede",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/136b9ca7eebef78be14abf90d65c5e57b6bc5d36",
"reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"paragonie/constant_time_encoding": "^1|^2",
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
"php": ">=5.6.1"
"php": ">=5.3.3"
}, },
"require-dev": { "require-dev": {
"phing/phing": "~2.7", "phing/phing": "~2.7",
"phpunit/phpunit": "^5.7|^6.0|^9.4",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
"squizlabs/php_codesniffer": "~2.0" "squizlabs/php_codesniffer": "~2.0"
}, },
"suggest": { "suggest": {
@ -3295,7 +3176,7 @@
"phpseclib/bootstrap.php" "phpseclib/bootstrap.php"
], ],
"psr-4": { "psr-4": {
"phpseclib3\\": "phpseclib/"
"phpseclib\\": "phpseclib/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -3352,7 +3233,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/phpseclib/phpseclib/issues", "issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.5"
"source": "https://github.com/phpseclib/phpseclib/tree/2.0.30"
}, },
"funding": [ "funding": [
{ {
@ -3368,7 +3249,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-02-12T16:18:16+00:00"
"time": "2020-12-17T05:42:04+00:00"
}, },
{ {
"name": "psr/cache", "name": "psr/cache",
@ -4140,29 +4021,30 @@
}, },
{ {
"name": "spatie/laravel-medialibrary", "name": "spatie/laravel-medialibrary",
"version": "8.10.1",
"version": "9.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/laravel-medialibrary.git", "url": "https://github.com/spatie/laravel-medialibrary.git",
"reference": "72b408972ba0b994eb52f39d38169621699e549b"
"reference": "fe8dcb2a56b3061cd29d072c1e983a1e035a1671"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/72b408972ba0b994eb52f39d38169621699e549b",
"reference": "72b408972ba0b994eb52f39d38169621699e549b",
"url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/fe8dcb2a56b3061cd29d072c1e983a1e035a1671",
"reference": "fe8dcb2a56b3061cd29d072c1e983a1e035a1671",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-exif": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-json": "*", "ext-json": "*",
"illuminate/bus": "^6.18|^7.0|^8.0",
"illuminate/console": "^6.18|^7.0|^8.0",
"illuminate/database": "^6.18|^7.0|^8.0",
"illuminate/pipeline": "^6.18|^7.0|^8.0",
"illuminate/support": "^6.18|^7.0|^8.0",
"illuminate/bus": "^7.0|^8.0",
"illuminate/console": "^7.0|^8.0",
"illuminate/database": "^7.0|^8.0",
"illuminate/pipeline": "^7.0|^8.0",
"illuminate/support": "^7.0|^8.0",
"league/flysystem": "^1.0.64", "league/flysystem": "^1.0.64",
"maennchen/zipstream-php": "^1.0|^2.0", "maennchen/zipstream-php": "^1.0|^2.0",
"php": "^7.4",
"php": "^7.4|^8.0",
"spatie/image": "^1.4.0", "spatie/image": "^1.4.0",
"spatie/temporary-directory": "^1.1", "spatie/temporary-directory": "^1.1",
"symfony/console": "^4.4|^5.0" "symfony/console": "^4.4|^5.0"
@ -4178,8 +4060,7 @@
"guzzlehttp/guzzle": "^6.3|^7.0", "guzzlehttp/guzzle": "^6.3|^7.0",
"league/flysystem-aws-s3-v3": "^1.0.23", "league/flysystem-aws-s3-v3": "^1.0.23",
"mockery/mockery": "^1.3", "mockery/mockery": "^1.3",
"orchestra/testbench": "^4.0|^5.0|^6.0",
"php-ffmpeg/php-ffmpeg": "^0.16.0",
"orchestra/testbench": "^5.0|^6.0",
"phpunit/phpunit": "^9.1", "phpunit/phpunit": "^9.1",
"spatie/pdf-to-image": "^2.0", "spatie/pdf-to-image": "^2.0",
"spatie/phpunit-snapshot-assertions": "^4.0" "spatie/phpunit-snapshot-assertions": "^4.0"
@ -4228,7 +4109,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/spatie/laravel-medialibrary/issues", "issues": "https://github.com/spatie/laravel-medialibrary/issues",
"source": "https://github.com/spatie/laravel-medialibrary/tree/8.10.1"
"source": "https://github.com/spatie/laravel-medialibrary/tree/9.4.2"
}, },
"funding": [ "funding": [
{ {
@ -4240,7 +4121,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-10-05T21:54:57+00:00"
"time": "2021-01-15T07:55:54+00:00"
}, },
{ {
"name": "spatie/laravel-query-builder", "name": "spatie/laravel-query-builder",
@ -4363,76 +4244,6 @@
}, },
"time": "2020-11-09T15:54:21+00:00" "time": "2020-11-09T15:54:21+00:00"
}, },
{
"name": "spatie/laravel-query-builder",
"version": "3.3.4",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-query-builder.git",
"reference": "2e131b0c8ae600b6e3aabb5a1501c721862a0b8f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-query-builder/zipball/2e131b0c8ae600b6e3aabb5a1501c721862a0b8f",
"reference": "2e131b0c8ae600b6e3aabb5a1501c721862a0b8f",
"shasum": ""
},
"require": {
"illuminate/database": "^6.0|^7.0|^8.0",
"illuminate/http": "^6.0|^7.0|^8.0",
"illuminate/support": "^6.0|^7.0|^8.0",
"php": "^7.3|^8.0"
},
"require-dev": {
"ext-json": "*",
"laravel/legacy-factories": "^1.0.4",
"mockery/mockery": "^1.4",
"orchestra/testbench": "^4.9|^5.8|^6.3",
"phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Spatie\\QueryBuilder\\QueryBuilderServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Spatie\\QueryBuilder\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alex Vanderbist",
"email": "alex@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Easily build Eloquent queries from API requests",
"homepage": "https://github.com/spatie/laravel-query-builder",
"keywords": [
"laravel-query-builder",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/laravel-query-builder/issues",
"source": "https://github.com/spatie/laravel-query-builder"
},
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
}
],
"time": "2020-11-26T14:51:30+00:00"
},
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
"version": "v6.2.5", "version": "v6.2.5",
@ -9515,9 +9326,9 @@
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^7.3|^8.0",
"ext-gd": "*", "ext-gd": "*",
"ext-json": "*"
"ext-json": "*",
"php": "^7.3|^8.0"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.0.0" "plugin-api-version": "2.0.0"

232
config.default/app.php

@ -1,232 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];

72
config.default/filesystems.php

@ -1,72 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];

104
config.default/logging.php

@ -1,104 +0,0 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

33
config.default/services.php

@ -1,33 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
];

73
config/amqp.php

@ -1,73 +0,0 @@
<?php
use PhpAmqpLib\Message\AMQPMessage;
return [
/* Default connection */
'default' => env('AMQP_CONNECTION', 'rabbitmq'),
/*Available connections*/
'connections' => [
'rabbitmq' => [
'connection' => [
'host' => env('AMQP_HOST', 'liwo_redis_1'),
'port' => env('AMQP_PORT', 5672),
'username' => env('AMQP_USERNAME', 'root'),
'password' => env('AMQP_PASSWORD', 'root'),
'vhost' => env('AMQP_VHOST', '/'),
'connect_options' => [],
'ssl_options' => [],
'ssl_protocol' => env('AMQP_SSL_PROTOCOL', 'ssl'),
],
'channel_id' => null,
'message' => [
'content_type' => 'text/plain',
'delivery_mode' => env('AMQP_MESSAGE_DELIVERY_MODE', AMQPMessage::DELIVERY_MODE_PERSISTENT),
'content_encoding' => 'UTF-8',
],
'exchange' => [
'name' => env('AMQP_EXCHANGE_NAME', 'activity_exchange'),
'declare' => env('AMQP_EXCHANGE_DECLARE', false),
'type' => env('AMQP_EXCHANGE_TYPE', 'headers'),
'passive' => env('AMQP_EXCHANGE_PASSIVE', false),
'durable' => env('AMQP_EXCHANGE_DURABLE', true),
'auto_delete' => env('AMQP_EXCHANGE_AUTO_DEL', false),
'internal' => env('AMQP_EXCHANGE_INTERNAL', false),
'nowait' => env('AMQP_EXCHANGE_NOWAIT', false),
'properties' => [],
],
'queue' => [
'declare' => env('AMQP_QUEUE_DECLARE', false),
'passive' => env('AMQP_QUEUE_PASSIVE', false),
'durable' => env('AMQP_QUEUE_DURABLE', true),
'exclusive' => env('AMQP_QUEUE_EXCLUSIVE', false),
'auto_delete' => env('AMQP_QUEUE_AUTO_DEL', false),
'nowait' => env('AMQP_QUEUE_NOWAIT', false),
'd_properties' => [], // queue_declare properties/arguments
'b_properties' => [], // queue_bind properties/arguments
],
'consumer' => [
'tag' => env('AMQP_CONSUMER_TAG', ''),
'no_local' => env('AMQP_CONSUMER_NO_LOCAL', false),
'no_ack' => env('AMQP_CONSUMER_NO_ACK', false),
'exclusive' => env('AMQP_CONSUMER_EXCLUSIVE', false),
'nowait' => env('AMQP_CONSUMER_NOWAIT', false),
'ticket' => null,
'properties' => [],
],
'qos' => [
'enabled' => env('AMQP_QOS_ENABLED', false),
'qos_prefetch_size' => env('AMQP_QOS_PREF_SIZE', 0),
'qos_prefetch_count' => env('AMQP_QOS_PREF_COUNT', 1),
'qos_a_global' => env('AMQP_QOS_GLOBAL', false),
],
],
],
];

93
config/app.php

@ -1,13 +1,18 @@
<?php <?php
return [ return [
'name' => env('APP_NAME', 'Laravel'), 'name' => env('APP_NAME', 'Laravel'),
'env' => env('APP_ENV', 'production'), 'env' => env('APP_ENV', 'production'),
'debug' => (bool) env('APP_DEBUG', false), 'debug' => (bool) env('APP_DEBUG', false),
'timezone' => 'Asia/Tehran',
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
'timezone' => 'UTC',
'locale' => 'fa', 'locale' => 'fa',
@ -15,5 +20,89 @@ return [
'faker_locale' => 'fa_IR', 'faker_locale' => 'fa_IR',
'cache_ttl' => 60
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
]; ];

0
config.default/auth.php → config/auth.php

0
config.default/broadcasting.php → config/broadcasting.php

0
config.default/cache.php → config/cache.php

43
config/cors.php

@ -1,59 +1,34 @@
<?php <?php
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Laravel CORS Options
| Cross-Origin Resource Sharing (CORS) Configuration
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The allowed_methods and allowed_headers options are case-insensitive.
|
| You don't need to provide both allowed_origins and allowed_origins_patterns.
| If one of the strings passed matches, it is considered a valid origin.
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
| |
| If ['*'] is provided to allowed_methods, allowed_origins or allowed_headers
| all methods / origins / headers are allowed.
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
| |
*/ */
/*
* You can enable CORS for 1 or multiple paths.
* Example: ['api/*']
*/
'paths' => ['/*'],
'paths' => ['api/*', 'sanctum/csrf-cookie'],
/*
* Matches the request method. `['*']` allows all methods.
*/
'allowed_methods' => ['*'], 'allowed_methods' => ['*'],
/*
* Matches the request origin. `['*']` allows all origins. Wildcards can be used, eg `*.mydomain.com`
*/
'allowed_origins' => ['*'], 'allowed_origins' => ['*'],
/*
* Patterns that can be used with `preg_match` to match the origin.
*/
'allowedOriginsPatterns' => ['Content-Type', 'X-Requested-With'],
'allowed_origins_patterns' => [],
/*
* Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers.
*/
'allowed_headers' => ['*'], 'allowed_headers' => ['*'],
/*
* Sets the Access-Control-Expose-Headers response header with these headers.
*/
'exposed_headers' => [], 'exposed_headers' => [],
/*
* Sets the Access-Control-Max-Age response header when > 0.
*/
'max_age' => 0, 'max_age' => 0,
/*
* Sets the Access-Control-Allow-Credentials header.
*/
'supports_credentials' => false, 'supports_credentials' => false,
]; ];

59
config/cors.php.laravel

@ -0,0 +1,59 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel CORS Options
|--------------------------------------------------------------------------
|
| The allowed_methods and allowed_headers options are case-insensitive.
|
| You don't need to provide both allowed_origins and allowed_origins_patterns.
| If one of the strings passed matches, it is considered a valid origin.
|
| If ['*'] is provided to allowed_methods, allowed_origins or allowed_headers
| all methods / origins / headers are allowed.
|
*/
/*
* You can enable CORS for 1 or multiple paths.
* Example: ['api/*']
*/
'paths' => ['/*'],
/*
* Matches the request method. `['*']` allows all methods.
*/
'allowed_methods' => ['*'],
/*
* Matches the request origin. `['*']` allows all origins. Wildcards can be used, eg `*.mydomain.com`
*/
'allowed_origins' => ['*'],
/*
* Patterns that can be used with `preg_match` to match the origin.
*/
'allowedOriginsPatterns' => ['Content-Type', 'X-Requested-With'],
/*
* Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers.
*/
'allowed_headers' => ['*'],
/*
* Sets the Access-Control-Expose-Headers response header with these headers.
*/
'exposed_headers' => [],
/*
* Sets the Access-Control-Max-Age response header when > 0.
*/
'max_age' => 0,
/*
* Sets the Access-Control-Allow-Credentials header.
*/
'supports_credentials' => false,
];

0
config.default/cors.php → config/cors.php.lumen

0
config.default/database.php → config/database.php

0
config.default/hashing.php → config/hashing.php

2
config/logging.php

@ -16,7 +16,7 @@ return [
'handler' => AmqpHandler::class, 'handler' => AmqpHandler::class,
'with' => [ 'with' => [
'exchange' => new AMQPChannel( 'exchange' => new AMQPChannel(
new AMQPStreamConnection("liwo_redis_1", 5672, 'root', 'root')
new AMQPStreamConnection("liwo_rabbitmq_1", 5672, 'root', 'root')
), ),
'exchangeName' => 'log_exchange' 'exchangeName' => 'log_exchange'
], ],

0
config.default/mail.php → config/mail.php

0
config.default/queue.php → config/queue.php

0
config.default/session.php → config/session.php

0
config.default/view.php → config/view.php

152
definitions.json

@ -0,0 +1,152 @@
{
"queues": [
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "activity_queue",
"type": "classic",
"vhost": "/"
},
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "notif_queue",
"type": "classic",
"vhost": "/"
},
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "socket_queue",
"type": "classic",
"vhost": "/"
},
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "log_queue",
"type": "classic",
"vhost": "/"
}
],
"exchanges": [
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "activity_exchange",
"type": "headers",
"vhost": "/"
},
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "notif_exchange",
"type": "headers",
"vhost": "/"
},
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "socket_exchange",
"type": "headers",
"vhost": "/"
},
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "log_exchange",
"type": "fanout",
"vhost": "/"
}
],
"bindings": [
{
"arguments": {
"x-match": "any",
"name" : "activity"
},
"destination": "activity_queue",
"destination_type": "queue",
"routing_key": "",
"source": "activity_exchange",
"vhost": "/"
},
{
"arguments": {
"x-match": "any",
"name" : "notif"
},
"destination": "notif_queue",
"destination_type": "queue",
"routing_key": "",
"source": "notif_exchange",
"vhost": "/"
},
{
"arguments": {
"x-match": "any",
"name" : "socket"
},
"destination": "socket_queue",
"destination_type": "queue",
"routing_key": "",
"source": "socket_exchange",
"vhost": "/"
},
{
"arguments": {},
"destination": "log_queue",
"destination_type": "queue",
"routing_key": "",
"source": "log_exchange",
"vhost": "/"
}
],
"global_parameters": [
{
"name": "cluster_name",
"value": "rabbit@258a143f3102"
}
],
"parameters": [],
"permissions": [
{
"configure": ".*",
"read": ".*",
"user": "root",
"vhost": "/",
"write": ".*"
}
],
"policies": [],
"rabbit_version": "3.8.5",
"rabbitmq_version": "3.8.5",
"topic_permissions": [],
"users": [
{
"hashing_algorithm": "rabbit_password_hashing_sha256",
"name": "root",
"password_hash": "Y0AhwjtK6iQM0t0Hp9t9nBey8zzMBa3LuszL3zlZ1mGtWsif",
"tags": "administrator"
}
],
"vhosts": [
{
"limits": [],
"metadata": {
"description": "Default virtual host",
"tags": []
},
"name": "/"
}
]
}

24
docker-compose.yml

@ -1,6 +1,22 @@
# For more information: https://laravel.com/docs/sail # For more information: https://laravel.com/docs/sail
version: '3' version: '3'
services: services:
rabbitmq:
image: "rabbitmq:3-management"
ports:
- 5672:5672
- 15672:15672
environment:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "root"
RABBITMQ_DEFAULT_PASS: "root"
RABBITMQ_DEFAULT_VHOST: "/"
networks:
- sail
volumes:
- ./definitions.json:/etc/rabbitmq/definitions.json
depends_on:
- laravel
minio: minio:
image: minio/minio image: minio/minio
command: server /data command: server /data
@ -11,6 +27,8 @@ services:
MINIO_SECRET_KEY: minioroot MINIO_SECRET_KEY: minioroot
networks: networks:
- sail - sail
depends_on:
- laravel
commander: commander:
image: rediscommander/redis-commander:latest image: rediscommander/redis-commander:latest
environment: environment:
@ -25,6 +43,8 @@ services:
- redis - redis
networks: networks:
- sail - sail
depends_on:
- redis
redis: redis:
image: redis:latest image: redis:latest
ports: ports:
@ -34,7 +54,7 @@ services:
- redis-data:/data - redis-data:/data
networks: networks:
- sail - sail
laravel.test:
laravel:
build: build:
context: ./vendor/laravel/sail/runtimes/8.0 context: ./vendor/laravel/sail/runtimes/8.0
dockerfile: Dockerfile dockerfile: Dockerfile
@ -68,7 +88,7 @@ services:
- sail - sail
healthcheck: healthcheck:
test: ["CMD", "mysqladmin", "ping"] test: ["CMD", "mysqladmin", "ping"]
myadmin:
pma:
image: 'phpmyadmin:latest' image: 'phpmyadmin:latest'
ports: ports:
- 8080:80 - 8080:80

16
routes/api.php

@ -1,6 +1,6 @@
<?php <?php
/** @var \Laravel\Lumen\Routing\Router $router */
/** @var \Illuminate\Routing\$router */
$router->group(['prefix' => 'actions'], function () use ($router) { $router->group(['prefix' => 'actions'], function () use ($router) {
$router->group(['prefix' => 'businesses'], function () use ($router) { $router->group(['prefix' => 'businesses'], function () use ($router) {
@ -165,36 +165,36 @@ $router->group(['prefix' => 'users'], function () use ($router) {
}); });
$router->group([], function () use ($router) { $router->group([], function () use ($router) {
$router->post('/log', 'ActivityController@store'); $router->post('/log', 'ActivityController@store');
$router->group(['prefix' => 'businesses/{business}', 'middleware' => ['auth', 'bindBusiness']], function (Router $router) {
$router->group(['prefix' => 'businesses/{business}', 'middleware' => ['auth', 'bindBusiness']], function ($router) {
$router->get('/tasks', 'TaskController@index'); $router->get('/tasks', 'TaskController@index');
$router->get('/works', 'WorkController@index'); $router->get('/works', 'WorkController@index');
$router->get('statistics', 'StatisticController@index'); $router->get('statistics', 'StatisticController@index');
$router->get('projects/{project}/statistics', 'StatisticController@index'); $router->get('projects/{project}/statistics', 'StatisticController@index');
$router->get('/tasks/{task}', 'TaskController@show'); $router->get('/tasks/{task}', 'TaskController@show');
$router->group(['prefix' => 'projects/{project}/tasks'], function (Router $router) {
$router->group(['prefix' => 'projects/{project}/tasks'], function ($router) {
$router->post('/', 'TaskController@store'); $router->post('/', 'TaskController@store');
$router->group(['prefix' => '{task}'], function (Router $router) {
$router->group(['prefix' => '{task}'], function ($router) {
$router->get('/', 'TaskController@show'); $router->get('/', 'TaskController@show');
$router->put('/', 'TaskController@update'); $router->put('/', 'TaskController@update');
$router->delete('/', 'TaskController@destroy'); $router->delete('/', 'TaskController@destroy');
$router->post('/watchers', 'TaskController@toggleWatcher'); $router->post('/watchers', 'TaskController@toggleWatcher');
$router->group(['prefix' => 'works'], function (Router $router) {
$router->group(['prefix' => 'works'], function ($router) {
// $router->get('/', 'WorkController@index'); // $router->get('/', 'WorkController@index');
$router->post('/', 'WorkController@store'); $router->post('/', 'WorkController@store');
$router->group(['prefix' => '{work}'], function (Router $router) {
$router->group(['prefix' => '{work}'], function ($router) {
$router->get('/', 'WorkController@show'); $router->get('/', 'WorkController@show');
$router->put('/', 'WorkController@update'); $router->put('/', 'WorkController@update');
$router->delete('/', 'WorkController@destroy'); $router->delete('/', 'WorkController@destroy');
}); });
}); });
$router->group(['prefix' => 'comments'], function (Router $router) {
$router->group(['prefix' => 'comments'], function ($router) {
$router->get('/', 'CommentController@index'); $router->get('/', 'CommentController@index');
$router->post('/', 'CommentController@store'); $router->post('/', 'CommentController@store');
$router->group(['prefix' => '{comment}'], function (Router $router) {
$router->group(['prefix' => '{comment}'], function ($router) {
$router->get('/', 'CommentController@show'); $router->get('/', 'CommentController@show');
$router->put('/', 'CommentController@update'); $router->put('/', 'CommentController@update');
$router->delete('/', 'CommentController@destroy'); $router->delete('/', 'CommentController@destroy');

Loading…
Cancel
Save