Mohammad Akbari
4 years ago
53 changed files with 534 additions and 974 deletions
-
6app/Models/Activity.php
-
2app/Models/Business.php
-
2app/Models/Cost.php
-
2app/Models/File.php
-
2app/Models/Fingerprint.php
-
2app/Models/Project.php
-
2app/Models/SoftDeletes.php
-
2app/Models/Sprint.php
-
2app/Models/Status.php
-
2app/Models/System.php
-
2app/Models/Tag.php
-
4app/Models/TagTask.php
-
2app/Models/Transaction.php
-
2app/Models/User.php
-
2app/Models/Workflow.php
-
18app/Scopes/BusinessScope.php
-
8app/Statists/Pipe.php
-
44app/Statists/SprintStatist.php
-
22app/Statists/SystemStatist.php
-
54app/Statists/TagStatist.php
-
2app/Utilities/Exceptions/Handler.php
-
42app/Utilities/Jobs/AsyncCall.php
-
2app/Utilities/Logger/CreateCustomLogger.php
-
2app/Utilities/Logger/LogServiceRecordProcessor.php
-
23app/Utilities/Middlewares/BindBusinessInfo.php
-
2app/Utilities/Models/Model.php
-
2app/Utilities/Models/ReportableRelation.php
-
55app/Utilities/Providers/AuthServiceProvider.php
-
2app/Utilities/Providers/HiLibraryServiceProvider.php
-
32composer.json
-
259composer.lock
-
232config.default/app.php
-
72config.default/filesystems.php
-
104config.default/logging.php
-
33config.default/services.php
-
73config/amqp.php
-
93config/app.php
-
0config/auth.php
-
0config/broadcasting.php
-
0config/cache.php
-
43config/cors.php
-
59config/cors.php.laravel
-
0config/cors.php.lumen
-
0config/database.php
-
0config/hashing.php
-
2config/logging.php
-
0config/mail.php
-
0config/queue.php
-
0config/session.php
-
0config/view.php
-
152definitions.json
-
24docker-compose.yml
-
16routes/api.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 |
||||
{ |
{ |
||||
|
|
||||
} |
} |
@ -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')); |
|
||||
} |
|
||||
} |
|
@ -1,8 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
namespace App\Statists; |
|
||||
|
|
||||
interface Pipe |
|
||||
{ |
|
||||
public function handle(&$content, \Closure $next); |
|
||||
} |
|
@ -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); |
|
||||
} |
|
||||
} |
|
@ -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); |
|
||||
} |
|
||||
} |
|
@ -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); |
|
||||
} |
|
||||
} |
|
@ -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); |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
} |
@ -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, |
|
||||
|
|
||||
], |
|
||||
|
|
||||
]; |
|
@ -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'), |
|
||||
], |
|
||||
|
|
||||
]; |
|
@ -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'), |
|
||||
], |
|
||||
], |
|
||||
|
|
||||
]; |
|
@ -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'), |
|
||||
], |
|
||||
|
|
||||
]; |
|
@ -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), |
|
||||
], |
|
||||
], |
|
||||
], |
|
||||
]; |
|
@ -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, |
||||
|
|
||||
]; |
]; |
@ -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,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": "/" |
||||
|
} |
||||
|
] |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue