Compare commits
No commits in common. "main" and "master" have entirely different histories.
|
@ -0,0 +1,18 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
|
@ -0,0 +1,66 @@
|
|||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_TIMEZONE=UTC
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_LOCALE=en
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
# APP_MAINTENANCE_STORE=database
|
||||
|
||||
PHP_CLI_SERVER_WORKERS=4
|
||||
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=127.0.0.1
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=laravel
|
||||
# DB_USERNAME=root
|
||||
# DB_PASSWORD=
|
||||
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=120
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
BROADCAST_CONNECTION=log
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=database
|
||||
|
||||
CACHE_STORE=database
|
||||
CACHE_PREFIX=
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_CLIENT=phpredis
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=log
|
||||
MAIL_SCHEME=null
|
||||
MAIL_HOST=127.0.0.1
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
|
@ -0,0 +1,11 @@
|
|||
* text=auto eol=lf
|
||||
|
||||
*.blade.php diff=html
|
||||
*.css diff=css
|
||||
*.html diff=html
|
||||
*.md diff=markdown
|
||||
*.php diff=php
|
||||
|
||||
/.github export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
.styleci.yml export-ignore
|
|
@ -0,0 +1,23 @@
|
|||
/.phpunit.cache
|
||||
/node_modules
|
||||
/public/build
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/storage/pail
|
||||
/vendor
|
||||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpactor.json
|
||||
.phpunit.result.cache
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/auth.json
|
||||
/.fleet
|
||||
/.idea
|
||||
/.nova
|
||||
/.vscode
|
||||
/.zed
|
|
@ -0,0 +1,66 @@
|
|||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com/)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[WebReinvent](https://webreinvent.com/)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Jump24](https://jump24.co.uk)**
|
||||
- **[Redberry](https://redberry.international/laravel/)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
- **[byte5](https://byte5.de)**
|
||||
- **[OP.GG](https://op.gg)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* The list of the inputs that are never flashed to the session on validation exceptions.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $dontFlash = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register the exception handling callbacks for the application.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
public function render($request, Throwable $exception)
|
||||
{
|
||||
if ($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) {
|
||||
return response()->view('page404', [], 404);
|
||||
}
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
$this->middleware('auth')->only('logout');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\Models\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, ValidatesRequests;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\User;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
class CustomTableController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$data = User::query();
|
||||
$search = $request->input('search');
|
||||
if ($search) {
|
||||
$data->where('name', 'like', "%$search%");
|
||||
}
|
||||
$sortField = $request->input('sort_field');
|
||||
$sortOrder = $request->input('sort_order', 'asc');
|
||||
if ($sortField) {
|
||||
$data->orderBy($sortField, $sortOrder);
|
||||
}
|
||||
$perPage = $request->input('per_page', 10);
|
||||
$paginatedData = $data->paginate($perPage);
|
||||
$columns = [
|
||||
['title' => 'ID', 'dataIndex' => 'id'],
|
||||
['title' => 'Name', 'dataIndex' => 'name'],
|
||||
];
|
||||
$actions = [
|
||||
['type' => 'edit', 'name' => 'Edit', 'path' => '/edit', 'access' => true],
|
||||
['type' => 'delete', 'name' => 'Delete', 'path' => '#', 'access' => true],
|
||||
];
|
||||
|
||||
return view('custom-table', compact('paginatedData', 'columns', 'actions'));
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
User::find($id)->delete();
|
||||
return redirect()->back()->with('success', 'User deleted');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BreadcrumbController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$path = $request->path();
|
||||
$pathSnippets = array_filter(explode('/', $path));
|
||||
$root = empty($pathSnippets);
|
||||
|
||||
// Simulated pageRoutes (replace with your actual routes)
|
||||
$pageRoutes = [
|
||||
['path' => '/my-profile', 'name' => 'Home'],
|
||||
['path' => '/my-profile/users', 'name' => 'Users', 'params' => true],
|
||||
];
|
||||
|
||||
$extraBreadcrumbItems = [];
|
||||
foreach ($pathSnippets as $index => $snippet) {
|
||||
$url = '/' . implode('/', array_slice($pathSnippets, 0, $index + 1));
|
||||
$route = collect($pageRoutes)->firstWhere('path', $url);
|
||||
if ($route) {
|
||||
$paramsId = end($pathSnippets);
|
||||
$extraBreadcrumbItems[] = [
|
||||
'url' => $route['params'] ? "$url/$paramsId" : $url,
|
||||
'name' => $route['name'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return view('dashboard.breadcrumbs', compact('root', 'extraBreadcrumbItems'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ContentController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
// Simulated pageRoutes (replace with your actual routes)
|
||||
$pageRoutes = [
|
||||
['path' => '/my-profile', 'name' => 'Home'],
|
||||
['path' => '/my-profile/users', 'name' => 'Users', 'params' => true],
|
||||
];
|
||||
$root = $request->path() === '/my-profile';
|
||||
|
||||
return view('dashboard.content', compact('pageRoutes', 'root'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (!$user) {
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
$collapsed = session()->get('collapsed', false);
|
||||
$pageRoutes = [
|
||||
['path' => '/my-profile', 'name' => 'Home'],
|
||||
['path' => '/my-profile/users', 'name' => 'Users', 'params' => true],
|
||||
];
|
||||
$root = $request->path() === '/my-profile';
|
||||
|
||||
return view('dashboard.layout', compact('collapsed', 'user', 'pageRoutes', 'root'));
|
||||
}
|
||||
|
||||
public function logout(Request $request)
|
||||
{
|
||||
Auth::logout();
|
||||
return redirect()->route('login')->with('success', 'Logged out due to inactivity');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DataDisplayController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (!$user) {
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
$data = User::all();
|
||||
$layout = 'horizontal';
|
||||
$avatar = true;
|
||||
$viewPath = '/view';
|
||||
$header = 'User List';
|
||||
$footer = 'Total: ' . count($data) . ' users';
|
||||
|
||||
return view('dashboard.data-display', compact('data', 'layout', 'avatar', 'viewPath', 'header', 'footer'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FooterController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('dashboard.footer');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class HeaderController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (!$user) {
|
||||
return redirect()->route('login');
|
||||
}
|
||||
$collapsed = session()->get('collapsed', false); // Simulate toggle state
|
||||
return view('dashboard.header', compact('user', 'collapsed'));
|
||||
}
|
||||
|
||||
public function toggle(Request $request)
|
||||
{
|
||||
$collapsed = !$request->input('collapsed', false);
|
||||
session()->put('collapsed', $collapsed);
|
||||
return response()->json(['collapsed' => $collapsed]);
|
||||
}
|
||||
|
||||
public function logout(Request $request)
|
||||
{
|
||||
Auth::logout();
|
||||
return redirect()->route('login')->with('success', 'Logged out successfully');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RouteController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function index(Request $request, $component = null)
|
||||
{
|
||||
$view = $component ? "dashboard.{$component}" : 'dashboard.default';
|
||||
if (!view()->exists($view)) {
|
||||
return redirect()->route('login')->with('error', 'You must log in to enter this page');
|
||||
}
|
||||
return view('dashboard.route', compact('view'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SidebarController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (!$user) {
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
$collapsed = session()->get('collapsed', false);
|
||||
$navigation = [
|
||||
['key' => 0, 'label' => 'User Management', 'path' => '/user-management', 'icon' => 'team', 'access' => $user && $user->role == 1],
|
||||
['key' => 9, 'label' => 'Notifications', 'path' => '/notifications', 'icon' => 'notification', 'access' => true],
|
||||
['key' => 4, 'label' => 'Member Management', 'path' => '/member-management', 'icon' => 'credit-card', 'access' => $user && $user->role == 1, 'child' => [
|
||||
['key' => 0.0, 'label' => 'Card Member', 'path' => '/member-management/card-member', 'access' => true],
|
||||
['key' => 0.1, 'label' => 'Locked Accounts', 'path' => '/member-management/lock-account', 'access' => true],
|
||||
]],
|
||||
['key' => 8, 'label' => 'Home Page ( Mobile )', 'path' => '/home-page', 'icon' => 'home', 'access' => true, 'child' => [
|
||||
['key' => 0.0, 'label' => 'Photo Slider', 'path' => '/home-page/photo-slider', 'access' => true],
|
||||
]],
|
||||
['key' => 3, 'label' => 'Promotions', 'path' => '/promotions', 'icon' => 'tags', 'access' => true],
|
||||
['key' => 2, 'label' => 'Top-Up', 'path' => '/top-up', 'icon' => 'plus-circle', 'access' => $user && $user->role == 1],
|
||||
['key' => 6, 'label' => 'About Us', 'path' => '/about-us', 'icon' => 'info-circle', 'access' => $user && $user->role == 1, 'child' => [
|
||||
['key' => 0.6, 'label' => 'Card Types', 'path' => '/about-us/card-types', 'access' => true],
|
||||
['key' => 0.5, 'label' => 'Terms & Privacy', 'path' => '/about-us/term-privacy', 'access' => true],
|
||||
]],
|
||||
['key' => 7, 'label' => 'Reports', 'path' => '/reports', 'icon' => 'file-text', 'access' => true, 'child' => [
|
||||
['key' => 0.7, 'label' => 'Registration Report', 'path' => '/reports/registration-report', 'access' => true],
|
||||
['key' => 0.8, 'label' => 'Top-Up Usage Report', 'path' => '/reports/top-up', 'access' => true],
|
||||
['key' => 0.9, 'label' => 'Mobile Usage Report', 'path' => '/reports/mobile-report', 'access' => true],
|
||||
['key' => 0.1, 'label' => 'Station Rating Report', 'path' => '/reports/station-rating', 'access' => true],
|
||||
]],
|
||||
['key' => 8, 'label' => 'System Parameters', 'path' => '/system-parameters', 'icon' => 'setting', 'access' => $user && $user->role == 1],
|
||||
['key' => 12, 'label' => 'Station Locator', 'path' => '', 'icon' => 'environment', 'access' => true, 'child' => [
|
||||
['key' => 0.11, 'label' => 'Branches', 'path' => '/branches', 'access' => true],
|
||||
['key' => 0.12, 'label' => 'Stations', 'path' => '/stations', 'access' => true],
|
||||
['key' => 0.13, 'label' => 'Fuels', 'path' => '/fuels', 'access' => true],
|
||||
]],
|
||||
];
|
||||
|
||||
return view('dashboard.sidebar', compact('collapsed', 'navigation', 'user'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers\Dropdown;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Export;
|
||||
|
||||
class DropdownExportController extends Controller
|
||||
{
|
||||
public function export(Request $request)
|
||||
{
|
||||
$params = $request->all();
|
||||
if ($request->has('defaultFilter')) {
|
||||
$params = array_merge($params, $request->input('defaultFilter'));
|
||||
}
|
||||
|
||||
$data = User::all()->map(function ($user) {
|
||||
return implode(',', [$user->id, $user->name]) . "\n";
|
||||
})->implode('');
|
||||
|
||||
$filename = 'export_' . now()->format('mmddyyyy') . '.csv';
|
||||
Storage::put("exports/{$filename}", $data);
|
||||
|
||||
Export::create(['filename' => $filename, 'exported_at' => now()]);
|
||||
|
||||
return Response::download(storage_path("app/exports/{$filename}"))->deleteFileAfterSend(true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LoadingController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('loading');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Login;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LayoutController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('login.layout');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Login;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RouteController extends Controller
|
||||
{
|
||||
public function index(Request $request, $component = null)
|
||||
{
|
||||
$view = $component ? "login.{$component}" : 'login.default';
|
||||
if (!view()->exists($view)) {
|
||||
$view = 'login.default';
|
||||
}
|
||||
return view('login.route', compact('view'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Modal;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ModalCancelController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$path = $request->input('path', '/');
|
||||
$title = $request->input('title', 'Your Title');
|
||||
$message = $request->input('message', 'Your Message');
|
||||
$dirty = $request->input('dirty', true);
|
||||
$name = $request->input('name', 'Cancel');
|
||||
|
||||
return view('modal.cancel', compact('path', 'title', 'message', 'dirty', 'name'));
|
||||
}
|
||||
|
||||
public function confirm(Request $request)
|
||||
{
|
||||
return redirect($request->input('path', '/'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Notification;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
class NotificationTablesController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$data = Notification::query();
|
||||
$search = $request->input('search');
|
||||
if ($search) {
|
||||
$data->where('title', 'like', "%$search%");
|
||||
}
|
||||
$sortField = $request->input('_sort_by');
|
||||
$sortOrder = $request->input('_sort_order', 'asc') === 'asc' ? 'asc' : 'desc';
|
||||
if ($sortField) {
|
||||
$data->orderBy($sortField, $sortOrder);
|
||||
}
|
||||
$dateStart = $request->input('date_start');
|
||||
$dateEnd = $request->input('date_end');
|
||||
if ($dateStart && $dateEnd) {
|
||||
$data->whereBetween('created_at', [$dateStart, $dateEnd]);
|
||||
}
|
||||
$perPage = $request->input('page_size', 10);
|
||||
$currentPage = $request->input('page', 1);
|
||||
$paginatedData = $data->paginate($perPage);
|
||||
|
||||
$columns = [
|
||||
['title' => 'ID', 'dataIndex' => 'id'],
|
||||
['title' => 'Title', 'dataIndex' => 'title'],
|
||||
];
|
||||
$actions = [
|
||||
['key' => 'edit', 'title' => 'Edit', 'icon' => 'edit'],
|
||||
['key' => 'delete', 'title' => 'Delete', 'icon' => 'delete'],
|
||||
];
|
||||
|
||||
return view('notification-tables', compact('paginatedData', 'columns', 'actions'));
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
Notification::find($id)->delete();
|
||||
return redirect()->back()->with('success', 'Notification deleted');
|
||||
}
|
||||
|
||||
public function batchDestroy(Request $request)
|
||||
{
|
||||
$ids = $request->input('ids', []);
|
||||
Notification::whereIn('id', $ids)->delete();
|
||||
return redirect()->back()->with('success', 'Notifications deleted');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class Page404Controller extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('page404');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\User;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$data = User::query();
|
||||
$search = $request->input('search');
|
||||
if ($search) {
|
||||
$data->where('name', 'like', "%$search%");
|
||||
}
|
||||
$sortField = $request->input('sort_field');
|
||||
$sortOrder = $request->input('sort_order', 'asc');
|
||||
if ($sortField) {
|
||||
$data->orderBy($sortField, $sortOrder);
|
||||
}
|
||||
$paginatedData = $data->paginate($request->input('per_page', 10));
|
||||
return view('users', compact('paginatedData'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Export extends Model
|
||||
{
|
||||
protected $fillable = ['filename', 'exported_at'];
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Notification extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'content', 'created_at'];
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = ['name', 'first_name', 'last_name', 'avatar'];
|
||||
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the command...
|
||||
$status = (require_once __DIR__.'/bootstrap/app.php')
|
||||
->handleCommand(new ArgvInput);
|
||||
|
||||
exit($status);
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
//
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
})->create();
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
];
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"$schema": "https://getcomposer.org/schema.json",
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The skeleton application for the Laravel framework.",
|
||||
"keywords": ["laravel", "framework"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"laravel/framework": "^11.31",
|
||||
"laravel/tinker": "^2.9",
|
||||
"laravel/ui": "^4.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pail": "^1.1",
|
||||
"laravel/pint": "^1.13",
|
||||
"laravel/sail": "^1.26",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.1",
|
||||
"phpunit/phpunit": "^11.0.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||
],
|
||||
"post-root-package-install": [
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi",
|
||||
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
||||
"@php artisan migrate --graceful --ansi"
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true,
|
||||
"php-http/discovery": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application, which will be used when the
|
||||
| framework needs to place the application's name in a notification or
|
||||
| other UI elements where an application name needs to be displayed.
|
||||
|
|
||||
*/
|
||||
|
||||
'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
|
||||
| the application so that it's available within Artisan commands.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. The timezone
|
||||
| is set to "UTC" by default as it is suitable for most use cases.
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => env('APP_TIMEZONE', 'UTC'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by Laravel's translation / localization methods. This option can be
|
||||
| set to any locale for which you plan to have translation strings.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => env('APP_LOCALE', 'en'),
|
||||
|
||||
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
||||
|
||||
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is utilized by Laravel's encryption services and should be set
|
||||
| to a random, 32 character string to ensure that all encrypted values
|
||||
| are secure. You should do this prior to deploying the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
'previous_keys' => [
|
||||
...array_filter(
|
||||
explode(',', env('APP_PREVIOUS_KEYS', ''))
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maintenance Mode Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options determine the driver used to determine and
|
||||
| manage Laravel's "maintenance mode" status. The "cache" driver will
|
||||
| allow maintenance mode to be controlled across multiple machines.
|
||||
|
|
||||
| Supported drivers: "file", "cache"
|
||||
|
|
||||
*/
|
||||
|
||||
'maintenance' => [
|
||||
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
|
||||
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default authentication "guard" and password
|
||||
| reset "broker" for your application. You may change these values
|
||||
| as required, but they're a perfect start for most applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'defaults' => [
|
||||
'guard' => env('AUTH_GUARD', 'web'),
|
||||
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, you may define every authentication guard for your application.
|
||||
| Of course, a great default configuration has been defined for you
|
||||
| which utilizes session storage plus the Eloquent user provider.
|
||||
|
|
||||
| All authentication guards have a user provider, which defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| system used by the application. Typically, Eloquent is utilized.
|
||||
|
|
||||
| Supported: "session"
|
||||
|
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All authentication guards have a user provider, which defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| system used by the application. Typically, Eloquent is utilized.
|
||||
|
|
||||
| If you have multiple user tables or models you may configure multiple
|
||||
| providers to represent the model / table. These providers may then
|
||||
| be assigned to any extra authentication guards you have defined.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => env('AUTH_MODEL', App\Models\User::class),
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Resetting Passwords
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options specify the behavior of Laravel's password
|
||||
| reset functionality, including the table utilized for token storage
|
||||
| and the user provider that is invoked to actually retrieve users.
|
||||
|
|
||||
| The expiry time is the number of minutes that each reset token will be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
| The throttle setting is the number of seconds a user must wait before
|
||||
| generating more password reset tokens. This prevents the user from
|
||||
| quickly generating a very large amount of password reset tokens.
|
||||
|
|
||||
*/
|
||||
|
||||
'passwords' => [
|
||||
'users' => [
|
||||
'provider' => 'users',
|
||||
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
|
||||
'expire' => 60,
|
||||
'throttle' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Confirmation Timeout
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define the amount of seconds before a password confirmation
|
||||
| window expires and users are asked to re-enter their password via the
|
||||
| confirmation screen. By default, the timeout lasts for three hours.
|
||||
|
|
||||
*/
|
||||
|
||||
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
|
||||
|
||||
];
|
|
@ -0,0 +1,108 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache store that will be used by the
|
||||
| framework. This connection is utilized if another isn't explicitly
|
||||
| specified when running a cache operation inside the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_STORE', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "array", "database", "file", "memcached",
|
||||
| "redis", "dynamodb", "octane", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'connection' => env('DB_CACHE_CONNECTION'),
|
||||
'table' => env('DB_CACHE_TABLE', 'cache'),
|
||||
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
|
||||
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
|
||||
],
|
||||
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path('framework/cache/data'),
|
||||
'lock_path' => storage_path('framework/cache/data'),
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||
'sasl' => [
|
||||
env('MEMCACHED_USERNAME'),
|
||||
env('MEMCACHED_PASSWORD'),
|
||||
],
|
||||
'options' => [
|
||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||
],
|
||||
'servers' => [
|
||||
[
|
||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||
'port' => env('MEMCACHED_PORT', 11211),
|
||||
'weight' => 100,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
|
||||
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
|
||||
],
|
||||
|
||||
'dynamodb' => [
|
||||
'driver' => 'dynamodb',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||
],
|
||||
|
||||
'octane' => [
|
||||
'driver' => 'octane',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
|
||||
| stores, there might be other applications using the same cache. For
|
||||
| that reason, you may prefix every cache key to avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
||||
|
||||
];
|
|
@ -0,0 +1,173 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for database operations. This is
|
||||
| the connection which will be utilized unless another connection
|
||||
| is explicitly specified when you execute a query / statement.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'sqlite'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below are all of the database connections defined for your application.
|
||||
| An example configuration is provided for each database system which
|
||||
| is supported by Laravel. You're free to add / remove connections.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'url' => env('DB_URL'),
|
||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||
'prefix' => '',
|
||||
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||
'busy_timeout' => null,
|
||||
'journal_mode' => null,
|
||||
'synchronous' => null,
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'mariadb' => [
|
||||
'driver' => 'mariadb',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1433'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run on the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => [
|
||||
'table' => 'migrations',
|
||||
'update_date_on_publish' => true,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer body of commands than a typical key-value system
|
||||
| such as Memcached. You may define your connection settings here.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
|
||||
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,80 @@
|
|||
<?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 for file storage.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('FILESYSTEM_DISK', 'local'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below you may configure as many filesystem disks as necessary, and you
|
||||
| may even configure multiple disks for the same driver. Examples for
|
||||
| most supported storage drivers are configured here for reference.
|
||||
|
|
||||
| Supported drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/private'),
|
||||
'serve' => true,
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'public',
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'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'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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'),
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
use Monolog\Handler\NullHandler;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Handler\SyslogUdpHandler;
|
||||
use Monolog\Processor\PsrLogMessageProcessor;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default log channel that is utilized to write
|
||||
| messages to your logs. The value provided here should match one of
|
||||
| the channels present in the list of "channels" configured below.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Deprecations Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the log channel that should be used to log warnings
|
||||
| regarding deprecated PHP and library features. This allows you to get
|
||||
| your application ready for upcoming major versions of dependencies.
|
||||
|
|
||||
*/
|
||||
|
||||
'deprecations' => [
|
||||
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
|
||||
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log channels for your application. Laravel
|
||||
| utilizes the Monolog PHP logging library, which includes a variety
|
||||
| of powerful log handlers and formatters that you're free to use.
|
||||
|
|
||||
| Available drivers: "single", "daily", "slack", "syslog",
|
||||
| "errorlog", "monolog", "custom", "stack"
|
||||
|
|
||||
*/
|
||||
|
||||
'channels' => [
|
||||
|
||||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => explode(',', env('LOG_STACK', 'single')),
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'days' => env('LOG_DAILY_DAYS', 14),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'driver' => 'slack',
|
||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
|
||||
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
|
||||
'level' => env('LOG_LEVEL', 'critical'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'papertrail' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
|
||||
'handler_with' => [
|
||||
'host' => env('PAPERTRAIL_URL'),
|
||||
'port' => env('PAPERTRAIL_PORT'),
|
||||
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
|
||||
],
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'stderr' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||
'with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'errorlog' => [
|
||||
'driver' => 'errorlog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => NullHandler::class,
|
||||
],
|
||||
|
||||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Mailer
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default mailer that is used to send all email
|
||||
| messages unless another mailer is explicitly specified when sending
|
||||
| the message. All additional mailers can be configured within the
|
||||
| "mailers" array. Examples of each type of mailer are provided.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('MAIL_MAILER', 'log'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mailer Configurations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure all of the mailers used by your application plus
|
||||
| their respective settings. Several examples have been configured for
|
||||
| you and you are free to add your own as your application requires.
|
||||
|
|
||||
| Laravel supports a variety of mail "transport" drivers that can be used
|
||||
| when delivering an email. You may specify which one you're using for
|
||||
| your mailers below. You may also add additional mailers if needed.
|
||||
|
|
||||
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
||||
| "postmark", "resend", "log", "array",
|
||||
| "failover", "roundrobin"
|
||||
|
|
||||
*/
|
||||
|
||||
'mailers' => [
|
||||
|
||||
'smtp' => [
|
||||
'transport' => 'smtp',
|
||||
'scheme' => env('MAIL_SCHEME'),
|
||||
'url' => env('MAIL_URL'),
|
||||
'host' => env('MAIL_HOST', '127.0.0.1'),
|
||||
'port' => env('MAIL_PORT', 2525),
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'timeout' => null,
|
||||
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'transport' => 'ses',
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'transport' => 'postmark',
|
||||
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
|
||||
// 'client' => [
|
||||
// 'timeout' => 5,
|
||||
// ],
|
||||
],
|
||||
|
||||
'resend' => [
|
||||
'transport' => 'resend',
|
||||
],
|
||||
|
||||
'sendmail' => [
|
||||
'transport' => 'sendmail',
|
||||
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'transport' => 'log',
|
||||
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'transport' => 'array',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'transport' => 'failover',
|
||||
'mailers' => [
|
||||
'smtp',
|
||||
'log',
|
||||
],
|
||||
],
|
||||
|
||||
'roundrobin' => [
|
||||
'transport' => 'roundrobin',
|
||||
'mailers' => [
|
||||
'ses',
|
||||
'postmark',
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all emails sent by your application to be sent from
|
||||
| the same address. Here you may specify a name and address that is
|
||||
| used globally for all emails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => [
|
||||
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,112 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Queue Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel's queue supports a variety of backends via a single, unified
|
||||
| API, giving you convenient access to each backend using identical
|
||||
| syntax for each. The default queue connection is defined below.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('QUEUE_CONNECTION', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Queue Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the connection options for every queue backend
|
||||
| used by your application. An example configuration is provided for
|
||||
| each backend supported by Laravel. You're also free to add more.
|
||||
|
|
||||
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sync' => [
|
||||
'driver' => 'sync',
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'connection' => env('DB_QUEUE_CONNECTION'),
|
||||
'table' => env('DB_QUEUE_TABLE', 'jobs'),
|
||||
'queue' => env('DB_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'beanstalkd' => [
|
||||
'driver' => 'beanstalkd',
|
||||
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
|
||||
'queue' => env('BEANSTALKD_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
|
||||
'block_for' => 0,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'sqs' => [
|
||||
'driver' => 'sqs',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||
'queue' => env('SQS_QUEUE', 'default'),
|
||||
'suffix' => env('SQS_SUFFIX'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
|
||||
'queue' => env('REDIS_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
|
||||
'block_for' => null,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Job Batching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following options configure the database and table that store job
|
||||
| batching information. These options can be updated to any database
|
||||
| connection and table which has been defined by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'batching' => [
|
||||
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||
'table' => 'job_batches',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Failed Queue Jobs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These options configure the behavior of failed queue job logging so you
|
||||
| can control how and where failed jobs are stored. Laravel ships with
|
||||
| support for storing failed jobs in a simple file or in a database.
|
||||
|
|
||||
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'failed' => [
|
||||
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||
'table' => 'failed_jobs',
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,38 @@
|
|||
<?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.
|
||||
|
|
||||
*/
|
||||
|
||||
'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'),
|
||||
],
|
||||
|
||||
'resend' => [
|
||||
'key' => env('RESEND_KEY'),
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'notifications' => [
|
||||
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
|
||||
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines the default session driver that is utilized for
|
||||
| incoming requests. Laravel supports a variety of storage options to
|
||||
| persist session data. Database storage is a great default choice.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "dynamodb", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('SESSION_DRIVER', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to expire immediately when the browser is closed then you may
|
||||
| indicate that via the expire_on_close configuration option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => (int) env('SESSION_LIFETIME', 120),
|
||||
|
||||
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Encryption
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to easily specify that all of your session data
|
||||
| should be encrypted before it's stored. All encryption is performed
|
||||
| automatically by Laravel and you may use the session like normal.
|
||||
|
|
||||
*/
|
||||
|
||||
'encrypt' => env('SESSION_ENCRYPT', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the "file" session driver, the session files are placed
|
||||
| on disk. The default storage location is defined here; however, you
|
||||
| are free to provide another location where they should be stored.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path('framework/sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => env('SESSION_CONNECTION'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table to
|
||||
| be used to store sessions. Of course, a sensible default is defined
|
||||
| for you; however, you're welcome to change this to another table.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => env('SESSION_TABLE', 'sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using one of the framework's cache driven session backends, you may
|
||||
| define the cache store which should be used to store the session data
|
||||
| between requests. This must match one of your defined cache stores.
|
||||
|
|
||||
| Affects: "apc", "dynamodb", "memcached", "redis"
|
||||
|
|
||||
*/
|
||||
|
||||
'store' => env('SESSION_STORE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => [2, 100],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the session cookie that is created by
|
||||
| the framework. Typically, you should not need to change this value
|
||||
| since doing so does not grant a meaningful security improvement.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => env(
|
||||
'SESSION_COOKIE',
|
||||
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application, but you're free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => env('SESSION_PATH', '/'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the domain and subdomains the session cookie is
|
||||
| available to. By default, the cookie will be available to the root
|
||||
| domain and all subdomains. Typically, this shouldn't be changed.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('SESSION_DOMAIN'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you when it can't be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTP Access Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will prevent JavaScript from accessing the
|
||||
| value of the cookie and the cookie will only be accessible through
|
||||
| the HTTP protocol. It's unlikely you should disable this option.
|
||||
|
|
||||
*/
|
||||
|
||||
'http_only' => env('SESSION_HTTP_ONLY', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Same-Site Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines how your cookies behave when cross-site requests
|
||||
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||
| will set this value to "lax" to permit secure cross-site requests.
|
||||
|
|
||||
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
||||
|
|
||||
| Supported: "lax", "strict", "none", null
|
||||
|
|
||||
*/
|
||||
|
||||
'same_site' => env('SESSION_SAME_SITE', 'lax'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Partitioned Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will tie the cookie to the top-level site for
|
||||
| a cross-site context. Partitioned cookies are accepted by the browser
|
||||
| when flagged "secure" and the Same-Site attribute is set to "none".
|
||||
|
|
||||
*/
|
||||
|
||||
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
|
||||
|
||||
];
|
|
@ -0,0 +1 @@
|
|||
*.sqlite*
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration');
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('last_name')->nullable();
|
||||
$table->string('avatar')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExportsTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exports', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('filename');
|
||||
$table->timestamp('exported_at');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exports');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateNotificationsTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->text('content')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
laravel-app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/laravel/Dockerfile
|
||||
image: laravel-app:latest
|
||||
volumes:
|
||||
- ./app:/var/www/html
|
||||
networks:
|
||||
- app-network
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "pgrep", "php-fpm"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./public:/var/www/html/public
|
||||
- ./frontend/build:/usr/share/nginx/html
|
||||
ports:
|
||||
- "80:80"
|
||||
networks:
|
||||
- app-network
|
||||
depends_on:
|
||||
laravel-app:
|
||||
condition: service_healthy
|
||||
react-app:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root_password
|
||||
MYSQL_DATABASE: laravel_db
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
networks:
|
||||
- app-network
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
mysql-data:
|
|
@ -0,0 +1,41 @@
|
|||
# Set up PHP for Laravel
|
||||
FROM php:8.2-fpm
|
||||
|
||||
# Install necessary system dependencies, including oniguruma
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libpng-dev \
|
||||
libjpeg-dev \
|
||||
libfreetype6-dev \
|
||||
zip \
|
||||
git \
|
||||
unzip \
|
||||
libonig-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install PHP extensions
|
||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg && \
|
||||
docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
|
||||
|
||||
# Install Composer
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Copy entire Laravel project (including artisan)
|
||||
COPY . .
|
||||
|
||||
# Install PHP dependencies
|
||||
RUN composer install --no-interaction --optimize-autoloader --no-dev
|
||||
|
||||
# Set permissions for storage and cache
|
||||
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
RUN chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
|
||||
# Make artisan executable
|
||||
RUN chmod +x /var/www/html/artisan
|
||||
|
||||
# Expose port for PHP-FPM
|
||||
EXPOSE 9000
|
||||
|
||||
CMD ["php-fpm"]
|
|
@ -0,0 +1,38 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# Serve the React app (static files)
|
||||
location / {
|
||||
root /usr/share/nginx/html; # Point to React build output
|
||||
try_files $uri $uri/ /index.html; # Ensure React routing works
|
||||
index index.html;
|
||||
}
|
||||
|
||||
# Proxy API requests to Laravel
|
||||
location /api/ {
|
||||
proxy_pass http://laravel-app:9000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Handle PHP files for Laravel
|
||||
location ~ ^/index.php(/|$) {
|
||||
fastcgi_pass laravel-app:9000;
|
||||
fastcgi_param SCRIPT_FILENAME /var/www/html/public$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
}
|
||||
|
||||
# Serve static files (e.g., from Laravel public)
|
||||
location /static/ {
|
||||
root /var/www/html/public; # Laravel static files
|
||||
}
|
||||
|
||||
# Cache static assets
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf|txt|xml)$ {
|
||||
expires 365d;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
[ignore]
|
||||
./components
|
||||
[include]
|
||||
|
||||
[libs]
|
||||
.*/node_modules/*
|
||||
[lints]
|
||||
|
||||
[options]
|
||||
|
||||
|
||||
[strict]
|
|
@ -0,0 +1,50 @@
|
|||
# These are some examples of commonly ignored file patterns.
|
||||
# You should customize this list as applicable to your project.
|
||||
# Learn more about .gitignore:
|
||||
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
|
||||
|
||||
# Node artifact files
|
||||
node_modules/
|
||||
dist/
|
||||
|
||||
# Compiled Java class files
|
||||
*.class
|
||||
|
||||
# Compiled Python bytecode
|
||||
*.py[cod]
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
|
||||
# Package files
|
||||
*.jar
|
||||
|
||||
# Maven
|
||||
target/
|
||||
dist/
|
||||
|
||||
# JetBrains IDE
|
||||
.idea/
|
||||
|
||||
# Unit test reports
|
||||
TEST*.xml
|
||||
|
||||
# Generated by MacOS
|
||||
.DS_Store
|
||||
|
||||
# Generated by Windows
|
||||
Thumbs.db
|
||||
|
||||
# Applications
|
||||
*.app
|
||||
*.exe
|
||||
*.war
|
||||
|
||||
# Large media files
|
||||
*.mp4
|
||||
*.tiff
|
||||
*.avi
|
||||
*.flv
|
||||
*.mov
|
||||
*.wmv
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
image: node:latest
|
||||
|
||||
before_script:
|
||||
- apt-get update -qy
|
||||
- apt-get install -y ruby-dev
|
||||
- gem install dpl
|
||||
|
||||
stages:
|
||||
- testing
|
||||
- staging
|
||||
- production
|
||||
|
||||
testing:
|
||||
type: deploy
|
||||
stage: testing
|
||||
image: ruby:latest
|
||||
script:
|
||||
- dpl --provider=heroku --app=$HEROKU_APP_TESTING --api-key=$HEROKU_API_KEY
|
||||
only:
|
||||
- testing
|
||||
|
||||
staging:
|
||||
type: deploy
|
||||
stage: staging
|
||||
image: ruby:latest
|
||||
script:
|
||||
- dpl --provider=heroku --app=$HEROKU_APP_STAGING --api-key=$HEROKU_API_KEY
|
||||
only:
|
||||
- staging
|
||||
|
||||
# production:
|
||||
# type: deploy
|
||||
# stage: production
|
||||
# image: ruby:latest
|
||||
# script:
|
||||
# - dpl --provider=heroku --app=$HEROKU_APP_PRODUCTION --api-key=$HEROKU_API_KEY
|
||||
# only:
|
||||
# - master
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# Stage 1 - the build process
|
||||
FROM node:18 as builder
|
||||
RUN mkdir /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
ENV PATH /usr/src/app/node_modules/.bin:$PATH
|
||||
ARG REACT_APP_PATH
|
||||
ARG REACT_APP_DOMAIN
|
||||
ARG REACT_APP_IMG_PATH
|
||||
ARG REACT_APP_PUBLIC
|
||||
ARG PUBLIC_URL
|
||||
ARG GENERATE_SOURCEMAP
|
||||
ENV REACT_APP_API $REACT_APP_DOMAIN/$REACT_APP_PATH
|
||||
ENV REACT_APP_IMG_URL $REACT_APP_DOMAIN/$REACT_APP_IMG_PATH
|
||||
RUN echo "DEBUG": $PUBLIC_URL
|
||||
|
||||
# Copy package.json and yarn.lock files first to leverage Docker cache
|
||||
COPY package.json yarn.lock /usr/src/app/
|
||||
RUN yarn install # Install dependencies
|
||||
|
||||
# Copy the rest of your application
|
||||
COPY . /usr/src/app
|
||||
|
||||
# Build the app
|
||||
RUN yarn build --ignore-scripts
|
||||
|
||||
# Stage 2 - the production environment
|
||||
FROM nginx:1.13.9-alpine
|
||||
|
||||
# Clean existing configuration and copy new one
|
||||
RUN rm -rf /etc/nginx/conf.d
|
||||
COPY conf /etc/nginx
|
||||
|
||||
# Clear the default content in the nginx folder
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# Copy the build folder from the builder stage to Nginx's public folder
|
||||
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
|
||||
|
||||
# Run Nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
|
@ -0,0 +1,54 @@
|
|||
dev-server:
|
||||
docker-compose up -d --build dev-build
|
||||
.PHONY: dev-server
|
||||
|
||||
dev-server-stop:
|
||||
docker-compose stop -t 1 dev-build
|
||||
.PHONY: dev-server-stop
|
||||
|
||||
test-server:
|
||||
docker-compose up -d --build test-build
|
||||
.PHONY: test-server
|
||||
|
||||
test-server-stop:
|
||||
docker-compose stop -t 1 test-build
|
||||
.PHONY: test-server-stop
|
||||
|
||||
prod-server:
|
||||
docker-compose -f docker-compose-prod.yml up -d --build
|
||||
.PHONY: prod-server
|
||||
|
||||
prod-server-stop:
|
||||
docker-compose -f docker-compose-prod.yml down
|
||||
.PHONY: prod-server-stop
|
||||
|
||||
dev-public-callback-server:
|
||||
docker-compose up -d --build public-dev-build
|
||||
.PHONY: dev-public-callback-server
|
||||
|
||||
dev-public-callback-server-stop:
|
||||
docker-compose stop -t 1 public-dev-build
|
||||
.PHONY: dev-public-callback-server-stop
|
||||
|
||||
test-public-callback-server:
|
||||
docker-compose up -d --build public-test-build
|
||||
.PHONY: test-public-callback-server
|
||||
|
||||
test-public-callback-server-stop:
|
||||
docker-compose stop -t 1 public-test-build
|
||||
.PHONY: test-public-callback-server-stop
|
||||
|
||||
prod-public-callback-server:
|
||||
docker-compose -f docker-compose-public.yml up -d --build
|
||||
.PHONY: prod-public-callback-server
|
||||
|
||||
prod-public-callback-server-stop:
|
||||
docker-compose -f docker-compose-public.yml down
|
||||
.PHONY: prod-public-callback-server-stop
|
||||
|
||||
stop:
|
||||
docker-compose down
|
||||
.PHONY: stop
|
||||
|
||||
clean:
|
||||
docker system prune --volumes -f
|
|
@ -0,0 +1,74 @@
|
|||
|
||||
## Server Dependences
|
||||
|
||||
* [Docker/Linux](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
|
||||
* [Docker Compose/Linux](https://docs.docker.com/compose/install/#install-compose)
|
||||
|
||||
### `sudo apt-get update`
|
||||
### `sudo apt-get install build-essential`
|
||||
|
||||
## CMS - Local Development Scripts
|
||||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm start`
|
||||
|
||||
Runs the app in the development mode.<br>
|
||||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
||||
|
||||
The page will reload if you make edits.<br>
|
||||
You will also see any lint errors in the console.
|
||||
|
||||
## Development Server Scripts
|
||||
|
||||
Up the server for staging development run:
|
||||
### `make dev-server`
|
||||
|
||||
Stop the server run:
|
||||
### `make dev-server-stop`
|
||||
|
||||
## QA/Testing Server Scripts
|
||||
|
||||
Up the server for staging QA/Testing run:
|
||||
### `make test-server`
|
||||
|
||||
Stop the server run:
|
||||
### `make test-server-stop`
|
||||
|
||||
## Production Server Scripts
|
||||
|
||||
Up the server for production run:
|
||||
### `make prod-server`
|
||||
|
||||
Stop the server run:
|
||||
### `make prod-server-stop`
|
||||
|
||||
Clean image container run:
|
||||
### `make clean`
|
||||
|
||||
|
||||
|
||||
## Public Development Server Scripts
|
||||
|
||||
Up the server for staging development run:
|
||||
### `make dev-public-callback-server`
|
||||
|
||||
Stop the server run:
|
||||
### `make dev-public-callback-server-stop`
|
||||
|
||||
## Public QA/Testing Server Scripts
|
||||
|
||||
Up the server for staging QA/Testing run:
|
||||
### `make test-public-callback-server`
|
||||
|
||||
Stop the server run:
|
||||
### `make test-public-callback-server-stop`
|
||||
|
||||
## Public Production Server Scripts
|
||||
|
||||
Up the server for staging QA/Testing run:
|
||||
### `make prod-public-callback-server`
|
||||
|
||||
Stop the server run:
|
||||
### `make prod-public-callback-server-stop`
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 17 KiB |
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon_unioil.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
}
|
||||
],
|
||||
"start_url": "./index.html",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
# read more here http://tautt.com/best-nginx-configuration-for-security/
|
||||
|
||||
# add_header Server "mystartup/1.0" always;
|
||||
# config to don't allow the browser to render the page inside an frame or iframe
|
||||
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
|
||||
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
|
||||
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
|
||||
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
|
||||
# to disable content-type sniffing on some browsers.
|
||||
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
|
||||
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
|
||||
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx
|
||||
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
|
||||
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.
|
||||
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for
|
||||
# this particular website if it was disabled by the user.
|
||||
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
||||
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),
|
||||
# you can tell the browser that it can only download content from the domains you explicitly allow
|
||||
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
||||
# https://www.owasp.org/index.php/Content_Security_Policy
|
||||
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'
|
||||
# directives for css and js(if you have inline css or js, you will need to keep it too).
|
||||
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful
|
||||
# add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://ssl.google-analytics.com https://s-static.ak.facebook.com https://assets.zendesk.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com; frame-src https://assets.zendesk.com https://www.facebook.com https://s-static.ak.facebook.com https://tautt.zendesk.com; object-src 'none'";
|
||||
# add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
|
||||
|
||||
|
||||
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
sendfile on;
|
||||
|
||||
default_type application/octet-stream;
|
||||
# more_clear_headers Server;
|
||||
# more_set_headers 'Server: Powered by Yondu';
|
||||
# don't send the nginx version number in error pages and Server header
|
||||
server_tokens off;
|
||||
|
||||
|
||||
|
||||
gzip on;
|
||||
gzip_http_version 1.1;
|
||||
gzip_disable "MSIE [1-6]\.";
|
||||
gzip_min_length 256;
|
||||
gzip_vary on;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types
|
||||
application/atom+xml
|
||||
application/javascript
|
||||
application/json
|
||||
application/ld+json
|
||||
application/manifest+json
|
||||
application/rss+xml
|
||||
application/vnd.geo+json
|
||||
application/vnd.ms-fontobject
|
||||
application/x-font-ttf
|
||||
application/x-web-app-manifest+json
|
||||
application/xhtml+xml
|
||||
application/xml
|
||||
font/opentype
|
||||
image/bmp
|
||||
image/svg+xml
|
||||
image/x-icon
|
||||
text/cache-manifest
|
||||
text/css
|
||||
text/plain
|
||||
text/vcard
|
||||
text/vnd.rim.location.xloc
|
||||
text/vtt
|
||||
text/x-component
|
||||
text/x-cross-domain-policy;
|
||||
# text/html is always compressed by gzip module
|
||||
gzip_comp_level 9;
|
||||
server_name *.example.org;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# . files
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
# cache.appcache, your document html and data
|
||||
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
|
||||
expires -1;
|
||||
# access_log logs/static.log; # I don't usually include a static log
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Media: images, icons, video, audio, HTC
|
||||
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
|
||||
expires 1M;
|
||||
access_log off;
|
||||
|
||||
}
|
||||
|
||||
# location ~* (service-worker\.js)$ {
|
||||
# add_header Cache-Control no-store, no-cache;
|
||||
# expires -1;
|
||||
# proxy_no_cache 1;
|
||||
|
||||
# }
|
||||
|
||||
# CSS and Javascript
|
||||
location ~* /static/.*\.(?:css|js)$ {
|
||||
expires 1y;
|
||||
access_log off;
|
||||
|
||||
}
|
||||
|
||||
|
||||
# location /service-worker.js {
|
||||
# expires -1;
|
||||
# add_header Cache-Control no-store, no-cache;
|
||||
# access_log off;
|
||||
# }
|
||||
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,491 @@
|
|||
const { injectBabelPlugin } = require("react-app-rewired");
|
||||
const rewireLess = require("react-app-rewire-less");
|
||||
// const VariablesOutput = require('less-plugin-variables-output');
|
||||
|
||||
// const fs = require('fs');
|
||||
// const path = require('path');
|
||||
// const less = require('less');
|
||||
|
||||
module.exports = function override(config, env) {
|
||||
|
||||
config = injectBabelPlugin(['import', { libraryName: 'antd', style: true }], config); // change importing css to less
|
||||
config = rewireLess.withLoaderOptions({
|
||||
javascriptEnabled: true,
|
||||
modifyVars: {
|
||||
// "@primary-color": "#1DA57A" ,
|
||||
|
||||
|
||||
'@primary-color' : '#1890ff',
|
||||
'@info-color' : '#1890ff',
|
||||
'@success-color ' : '#52c41a',
|
||||
'@processing-color' : '#1890ff',
|
||||
'@error-color' : '#f5222d',
|
||||
'@highlight-color' : '#f5222d',
|
||||
'@warning-color' : '#faad14',
|
||||
'@normal-color' : '#d9d9d9',
|
||||
|
||||
// Color used by default to control hover and active backgrounds and for
|
||||
// alert info backgrounds.
|
||||
// @primary-1: color(~`colorPalette("@{primary-color}", 1)`); // replace tint(@primary-color, 90%)
|
||||
// @primary-2: color(~`colorPalette("@{primary-color}", 2)`); // replace tint(@primary-color, 80%)
|
||||
// @primary-3: color(~`colorPalette("@{primary-color}", 3)`); // unused
|
||||
// @primary-4: color(~`colorPalette("@{primary-color}", 4)`); // unused
|
||||
// @primary-5: color(~`colorPalette("@{primary-color}", 5)`); // color used to control the text color in many active and hover states, replace tint(@primary-color, 20%)
|
||||
// @primary-6: @primary-color; // color used to control the text color of active buttons, don't use, use @primary-color
|
||||
// @primary-7: color(~`colorPalette("@{primary-color}", 7)`); // replace shade(@primary-color, 5%)
|
||||
// @primary-8: color(~`colorPalette("@{primary-color}", 8)`); // unused
|
||||
// @primary-9: color(~`colorPalette("@{primary-color}", 9)`); // unused
|
||||
// @primary-10: color(~`colorPalette("@{primary-color}", 10)`); // unused
|
||||
|
||||
// Base Scaffolding Variables
|
||||
// ---
|
||||
|
||||
// Background color for `<body>`
|
||||
// @body-background : #fff;
|
||||
// Base background color for most components
|
||||
// @component-background : #fff;
|
||||
// @font-family-no-number : "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
// @font-family : "Monospaced Number", @font-family-no-number;
|
||||
// @code-family : Consolas, Menlo, Courier, monospace;
|
||||
// @heading-color : fade(#000, 85%);
|
||||
// @text-color : fade(#000, 65%);
|
||||
// @text-color-secondary : fade(#000, 45%);
|
||||
// @heading-color-dark : fade(#fff, 100%);
|
||||
// @text-color-dark : fade(#fff, 85%);
|
||||
// @text-color-secondary-dark: fade(#fff, 65%);
|
||||
'@font-size-base' : '14px'
|
||||
// @font-size-lg : @font-size-base + 2px;
|
||||
// @font-size-sm : 12px;
|
||||
// @line-height-base : 1.5;
|
||||
// @border-radius-base : 4px;
|
||||
// @border-radius-sm : 2px;
|
||||
|
||||
// vertical paddings
|
||||
// @padding-lg : 24px; // containers
|
||||
// @padding-md : 16px; // small containers and buttons
|
||||
// @padding-sm : 12px; // Form controls and items
|
||||
// @padding-xs : 8px; // small items
|
||||
|
||||
// vertical padding for all form controls
|
||||
// @control-padding-horizontal: @padding-sm;
|
||||
// @control-padding-horizontal-sm: @padding-xs;
|
||||
|
||||
// The background colors for active and hover states for things like
|
||||
// list items or table cells.
|
||||
// @item-active-bg : @primary-1;
|
||||
// @item-hover-bg : @primary-1;
|
||||
|
||||
// ICONFONT
|
||||
// @iconfont-css-prefix : anticon;
|
||||
// @icon-url : "https://at.alicdn.com/t/font_148784_v4ggb6wrjmkotj4i";
|
||||
|
||||
// LINK
|
||||
// @link-color : @primary-color;
|
||||
// @link-hover-color : color(~`colorPalette("@{link-color}", 5)`);
|
||||
// @link-active-color : color(~`colorPalette("@{link-color}", 7)`);
|
||||
// @link-decoration : none;
|
||||
// @link-hover-decoration : none;
|
||||
|
||||
// Animation
|
||||
// @ease-out : cubic-bezier(0.215, 0.61, 0.355, 1);
|
||||
// @ease-in : cubic-bezier(0.55, 0.055, 0.675, 0.19);
|
||||
// @ease-in-out : cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
// @ease-out-back : cubic-bezier(0.12, 0.4, 0.29, 1.46);
|
||||
// @ease-in-back : cubic-bezier(0.71, -0.46, 0.88, 0.6);
|
||||
// @ease-in-out-back : cubic-bezier(0.71, -0.46, 0.29, 1.46);
|
||||
// @ease-out-circ : cubic-bezier(0.08, 0.82, 0.17, 1);
|
||||
// @ease-in-circ : cubic-bezier(0.6, 0.04, 0.98, 0.34);
|
||||
// @ease-in-out-circ : cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
// @ease-out-quint : cubic-bezier(0.23, 1, 0.32, 1);
|
||||
// @ease-in-quint : cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
||||
// @ease-in-out-quint : cubic-bezier(0.86, 0, 0.07, 1);
|
||||
|
||||
// Border color
|
||||
// @border-color-base : hsv(0, 0, 85%); // base border outline a component
|
||||
// @border-color-split : hsv(0, 0, 91%); // split border inside a component
|
||||
// @border-width-base : 1px; // width of the border for a component
|
||||
// @border-style-base : solid; // style of a components border
|
||||
|
||||
// Outline
|
||||
// @outline-blur-size : 0;
|
||||
// @outline-width : 2px;
|
||||
// @outline-color : @primary-color;
|
||||
|
||||
// @background-color-light : hsv(0, 0, 98%); // background of header and selected item
|
||||
// @background-color-base : hsv(0, 0, 96%); // Default grey background color
|
||||
|
||||
// Disabled states
|
||||
// @disabled-color : fade(#000, 25%);
|
||||
// @disabled-bg : @background-color-base;
|
||||
// @disabled-color-dark : fade(#fff, 35%);
|
||||
|
||||
// Shadow
|
||||
// @shadow-color : rgba(0, 0, 0, .15);
|
||||
// @box-shadow-base : @shadow-1-down;
|
||||
// @shadow-1-up : 0 2px 8px @shadow-color;
|
||||
// @shadow-1-down : 0 2px 8px @shadow-color;
|
||||
// @shadow-1-left : -2px 0 8px @shadow-color;
|
||||
// @shadow-1-right : 2px 0 8px @shadow-color;
|
||||
// @shadow-2 : 0 4px 12px @shadow-color;
|
||||
|
||||
// Buttons
|
||||
// @btn-font-weight : 400;
|
||||
// @btn-border-radius-base : @border-radius-base;
|
||||
// @btn-border-radius-sm : @border-radius-base;
|
||||
|
||||
// @btn-primary-color : #fff;
|
||||
// @btn-primary-bg : @primary-color;
|
||||
|
||||
// @btn-default-color : @text-color;
|
||||
// @btn-default-bg : #fff;
|
||||
// @btn-default-border : @border-color-base;
|
||||
|
||||
// @btn-danger-color : @error-color;
|
||||
// @btn-danger-bg : @background-color-base;
|
||||
// @btn-danger-border : @border-color-base;
|
||||
|
||||
// @btn-disable-color : @disabled-color;
|
||||
// @btn-disable-bg : @disabled-bg;
|
||||
// @btn-disable-border : @border-color-base;
|
||||
|
||||
// @btn-padding-base : 0 @padding-md - 1px;
|
||||
// @btn-font-size-lg : @font-size-lg;
|
||||
// @btn-font-size-sm : @font-size-base;
|
||||
// @btn-padding-lg : @btn-padding-base;
|
||||
// @btn-padding-sm : 0 @padding-xs - 1px;
|
||||
|
||||
// @btn-height-base : 32px;
|
||||
// @btn-height-lg : 40px;
|
||||
// @btn-height-sm : 24px;
|
||||
|
||||
// @btn-circle-size : @btn-height-base;
|
||||
// @btn-circle-size-lg : @btn-height-lg;
|
||||
// @btn-circle-size-sm : @btn-height-sm;
|
||||
|
||||
// @btn-group-border : @primary-5;
|
||||
|
||||
// Checkbox
|
||||
// @checkbox-size : 16px;
|
||||
// @checkbox-color : @primary-color;
|
||||
|
||||
// Radio
|
||||
// @radio-size : 16px;
|
||||
// @radio-dot-color : @primary-color;
|
||||
|
||||
// Radio buttons
|
||||
// @radio-button-bg : @btn-default-bg;
|
||||
// @radio-button-color : @btn-default-color;
|
||||
// @radio-button-hover-color : @primary-5;
|
||||
// @radio-button-active-color : @primary-7;
|
||||
|
||||
// Media queries breakpoints
|
||||
// Extra small screen / phone
|
||||
// @screen-xs : 480px;
|
||||
// @screen-xs-min : @screen-xs;
|
||||
|
||||
// Small screen / tablet
|
||||
// @screen-sm : 576px;
|
||||
// @screen-sm-min : @screen-sm;
|
||||
|
||||
// Medium screen / desktop
|
||||
// @screen-md : 768px;
|
||||
// @screen-md-min : @screen-md;
|
||||
|
||||
// Large screen / wide desktop
|
||||
// @screen-lg : 992px;
|
||||
// @screen-lg-min : @screen-lg;
|
||||
|
||||
// Extra large screen / full hd
|
||||
// @screen-xl : 1200px;
|
||||
// @screen-xl-min : @screen-xl;
|
||||
|
||||
// Extra extra large screen / large descktop
|
||||
// @screen-xxl : 1600px;
|
||||
// @screen-xxl-min : @screen-xxl;
|
||||
|
||||
// provide a maximum
|
||||
// @screen-xs-max : (@screen-sm-min - 1px);
|
||||
// @screen-sm-max : (@screen-md-min - 1px);
|
||||
// @screen-md-max : (@screen-lg-min - 1px);
|
||||
// @screen-lg-max : (@screen-xl-min - 1px);
|
||||
// @screen-xl-max : (@screen-xxl-min - 1px);
|
||||
|
||||
// Grid system
|
||||
// @grid-columns : 24;
|
||||
// @grid-gutter-width : 0;
|
||||
|
||||
// Layout
|
||||
// @layout-body-background : #f0f2f5;
|
||||
// @layout-header-background : #001529;
|
||||
// @layout-footer-background : @layout-body-background;
|
||||
// @layout-header-height : 64px;
|
||||
// @layout-header-padding : 0 50px;
|
||||
// @layout-footer-padding : 24px 50px;
|
||||
// @layout-sider-background : @layout-header-background;
|
||||
// @layout-trigger-height : 48px;
|
||||
// @layout-trigger-background : #002140;
|
||||
// @layout-trigger-color : #fff;
|
||||
// @layout-zero-trigger-width : 36px;
|
||||
// @layout-zero-trigger-height : 42px;
|
||||
// Layout light theme
|
||||
// @layout-sider-background-light : #fff;
|
||||
// @layout-trigger-background-light: #fff;
|
||||
// @layout-trigger-color-light : @text-color;
|
||||
|
||||
// z-index list
|
||||
// @zindex-affix : 10;
|
||||
// @zindex-back-top : 10;
|
||||
// @zindex-modal-mask : 1000;
|
||||
// @zindex-modal : 1000;
|
||||
// @zindex-notification : 1010;
|
||||
// @zindex-message : 1010;
|
||||
// @zindex-popover : 1030;
|
||||
// @zindex-picker : 1050;
|
||||
// @zindex-dropdown : 1050;
|
||||
// @zindex-tooltip : 1060;
|
||||
|
||||
// Animation
|
||||
// @animation-duration-slow: .3s; // Modal
|
||||
// @animation-duration-base: .2s;
|
||||
// @animation-duration-fast: .1s; // Tooltip
|
||||
|
||||
// Form
|
||||
// ---
|
||||
// @label-required-color : @highlight-color;
|
||||
// @label-color : @heading-color;
|
||||
// @form-item-margin-bottom : 24px;
|
||||
// @form-item-trailing-colon : true;
|
||||
// @form-vertical-label-padding : 0 0 8px;
|
||||
// @form-vertical-label-margin : 0;
|
||||
|
||||
// Input
|
||||
// ---
|
||||
// @input-height-base : 32px;
|
||||
// @input-height-lg : 40px;
|
||||
// @input-height-sm : 24px;
|
||||
// @input-padding-horizontal : @control-padding-horizontal - 1px;
|
||||
// @input-padding-horizontal-base: @input-padding-horizontal;
|
||||
// @input-padding-horizontal-sm : @control-padding-horizontal-sm - 1px;
|
||||
// @input-padding-horizontal-lg : @input-padding-horizontal;
|
||||
// @input-padding-vertical-base : 4px;
|
||||
// @input-padding-vertical-sm : 1px;
|
||||
// @input-padding-vertical-lg : 6px;
|
||||
// @input-placeholder-color : hsv(0, 0, 75%);
|
||||
// @input-color : @text-color;
|
||||
// @input-border-color : @border-color-base;
|
||||
// @input-bg : #fff;
|
||||
// @input-addon-bg : @background-color-light;
|
||||
// @input-hover-border-color : @primary-color;
|
||||
// @input-disabled-bg : @disabled-bg;
|
||||
|
||||
// Tooltip
|
||||
// ---
|
||||
//* Tooltip max width
|
||||
// @tooltip-max-width: 250px;
|
||||
//** Tooltip text color
|
||||
// @tooltip-color: #fff;
|
||||
//** Tooltip background color
|
||||
// @tooltip-bg: rgba(0, 0, 0, .75);
|
||||
//** Tooltip arrow width
|
||||
// @tooltip-arrow-width: 5px;
|
||||
//** Tooltip distance with trigger
|
||||
// @tooltip-distance: @tooltip-arrow-width - 1px + 4px;
|
||||
//** Tooltip arrow color
|
||||
// @tooltip-arrow-color: @tooltip-bg;
|
||||
|
||||
// Popover
|
||||
// ---
|
||||
//** Popover body background color
|
||||
// @popover-bg: #fff;
|
||||
//** Popover text color
|
||||
// @popover-color: @text-color;
|
||||
//** Popover maximum width
|
||||
// @popover-min-width: 177px;
|
||||
//** Popover arrow width
|
||||
// @popover-arrow-width: 6px;
|
||||
//** Popover arrow color
|
||||
// @popover-arrow-color: @popover-bg;
|
||||
//** Popover outer arrow width
|
||||
//** Popover outer arrow color
|
||||
// @popover-arrow-outer-color: @popover-bg;
|
||||
//** Popover distance with trigger
|
||||
// @popover-distance: @popover-arrow-width + 4px;
|
||||
|
||||
// Modal
|
||||
// --
|
||||
// @modal-mask-bg: rgba(0, 0, 0, 0.65);
|
||||
|
||||
// Progress
|
||||
// --
|
||||
// @progress-default-color: @processing-color;
|
||||
// @progress-remaining-color: @background-color-base;
|
||||
|
||||
// Menu
|
||||
// ---
|
||||
// @menu-inline-toplevel-item-height: 40px;
|
||||
// @menu-item-height: 40px;
|
||||
// @menu-collapsed-width: 80px;
|
||||
// @menu-bg: @component-background;
|
||||
// @menu-item-color: @text-color;
|
||||
// @menu-highlight-color: @primary-color;
|
||||
// @menu-item-active-bg: @item-active-bg;
|
||||
// @menu-item-group-title-color: @text-color-secondary;
|
||||
// dark theme
|
||||
// @menu-dark-color: @text-color-secondary-dark;
|
||||
// @menu-dark-bg: @layout-header-background;
|
||||
// @menu-dark-arrow-color: #fff;
|
||||
// @menu-dark-submenu-bg: #000c17;
|
||||
// @menu-dark-highlight-color: #fff;
|
||||
// @menu-dark-item-active-bg: @primary-color;
|
||||
|
||||
// Spin
|
||||
// ---
|
||||
// @spin-dot-size-sm: 14px;
|
||||
// @spin-dot-size: 20px;
|
||||
// @spin-dot-size-lg: 32px;
|
||||
|
||||
// Table
|
||||
// --
|
||||
// @table-header-bg: @background-color-light;
|
||||
// @table-header-sort-bg: @background-color-base;
|
||||
// @table-row-hover-bg: @primary-1;
|
||||
// @table-selected-row-bg: #fafafa;
|
||||
// @table-expanded-row-bg: #fbfbfb;
|
||||
// @table-padding-vertical: 16px;
|
||||
// @table-padding-horizontal: 16px;
|
||||
|
||||
// Tag
|
||||
// --
|
||||
// @tag-default-bg: @background-color-light;
|
||||
// @tag-default-color: @text-color;
|
||||
// @tag-font-size: @font-size-sm;
|
||||
|
||||
// TimePicker
|
||||
// ---
|
||||
// @time-picker-panel-column-width: 56px;
|
||||
// @time-picker-panel-width: @time-picker-panel-column-width * 3;
|
||||
// @time-picker-selected-bg: @background-color-base;
|
||||
|
||||
// Carousel
|
||||
// ---
|
||||
// @carousel-dot-width: 16px;
|
||||
// @carousel-dot-height: 3px;
|
||||
// @carousel-dot-active-width: 24px;
|
||||
|
||||
// Badge
|
||||
// ---
|
||||
// @badge-height: 20px;
|
||||
// @badge-dot-size: 6px;
|
||||
// @badge-font-size: @font-size-sm;
|
||||
// @badge-font-weight: normal;
|
||||
// @badge-status-size: 6px;
|
||||
|
||||
// Rate
|
||||
// ---
|
||||
// @rate-star-color: @yellow-6;
|
||||
// @rate-star-bg: @border-color-split;
|
||||
|
||||
// Card
|
||||
// ---
|
||||
// @card-head-color: @heading-color;
|
||||
// @card-head-background: @component-background;
|
||||
// @card-head-padding: 16px;
|
||||
// @card-inner-head-padding: 12px;
|
||||
// @card-padding-base: 24px;
|
||||
// @card-padding-wider: 32px;
|
||||
// @card-actions-background: @background-color-light;
|
||||
// @card-shadow: 0 2px 8px rgba(0, 0, 0, .09);
|
||||
|
||||
// Tabs
|
||||
// ---
|
||||
// '@tabs-card-head-background': '@background-color-light';
|
||||
// '@tabs-card-height': '40px';
|
||||
// '@tabs-card-active-color': '@primary-color';
|
||||
// '@tabs-title-font-size': '@font-size-base';
|
||||
// '@tabs-title-font-size-lg': '@font-size-lg';
|
||||
// '@tabs-title-font-size-sm': '@font-size-base';
|
||||
// '@tabs-ink-bar-color': '@primary-color';
|
||||
// '@tabs-bar-margin': '0 0 16px 0';
|
||||
// '@tabs-horizontal-margin': '0 32px 0 0';
|
||||
// '@tabs-horizontal-padding': '12px 16px';
|
||||
// '@tabs-vertical-padding': '8px 24px';
|
||||
// '@tabs-vertical-margin': '0 0 16px 0';
|
||||
// '@tabs-scrolling-size': '32px';
|
||||
// '@tabs-highlight-color': '@primary-color';
|
||||
// '@tabs-hover-color': '@primary-5';
|
||||
// '@tabs-active-color': '@primary-7';
|
||||
|
||||
// BackTop
|
||||
// ---
|
||||
// '@back-top-color': '#fff';
|
||||
// '@back-top-bg': '@text-color-secondary';
|
||||
// '@back-top-hover-bg': '@text-color';
|
||||
|
||||
// Avatar
|
||||
// ---
|
||||
// '@avatar-size-base': '32px';
|
||||
// '@avatar-size-lg': '40px';
|
||||
// '@avatar-size-sm': '24px';
|
||||
// '@avatar-font-size-base': '18px';
|
||||
// '@avatar-font-size-lg': '24px';
|
||||
// '@avatar-font-size-sm': '14px';
|
||||
// '@avatar-bg': '#ccc';
|
||||
// '@avatar-color': '#fff';
|
||||
// '@avatar-border-radius': '@border-radius-base;'
|
||||
|
||||
// Switch
|
||||
// ---
|
||||
// '@switch-height': '22px';
|
||||
// '@switch-sm-height': '16px';
|
||||
// '@switch-sm-checked-margin-left': '-(@switch-sm-height - 3px)';
|
||||
// '@switch-disabled-opacity': '0.4';
|
||||
// '@switch-color': '@primary-color';
|
||||
|
||||
// Pagination
|
||||
// ---
|
||||
// '@pagination-item-size': '32px';
|
||||
// '@pagination-item-size-sm': '24px';
|
||||
// '@pagination-font-family': 'Arial';
|
||||
// '@pagination-font-weight-active': '500';
|
||||
|
||||
// Breadcrumb
|
||||
// ---
|
||||
// '@breadcrumb-base-color': '@text-color-secondary';
|
||||
// '@breadcrumb-last-item-color': '@text-color';
|
||||
// '@breadcrumb-font-size': '@font-size-base';
|
||||
// '@breadcrumb-icon-font-size': '@font-size-sm';
|
||||
// '@breadcrumb-link-color': '@text-color-secondary';
|
||||
// '@breadcrumb-link-color-hover': '@primary-5';
|
||||
// '@breadcrumb-separator-color': '@text-color-secondary';
|
||||
// '@breadcrumb-separator-margin': '0 @padding-xs';
|
||||
|
||||
// Slider
|
||||
// ---
|
||||
// '@slider-margin': '14px 6px 10px';
|
||||
// '@slider-rail-background-color': '@background-color-base';
|
||||
// '@slider-rail-background-color-hover': '#e1e1e1';
|
||||
// '@slider-track-background-color': '@primary-3';
|
||||
// '@slider-track-background-color-hover': '@primary-4';
|
||||
// '@slider-handle-color': '@primary-3';
|
||||
// '@slider-handle-color-hover': '@primary-4';
|
||||
// '@slider-handle-color-focus': 'tint(@primary-color, 20%)';
|
||||
// '@slider-handle-color-focus-shadow': 'tint(@primary-color, 50%)';
|
||||
// '@slider-handle-color-tooltip-open': '@primary-color';
|
||||
// '@slider-dot-border-color': '@border-color-split';
|
||||
// '@slider-dot-border-color-active': 'tint(@primary-color, 50%)';
|
||||
// '@slider-disabled-color': '@disabled-color';
|
||||
// '@slider-disabled-background-color': '@component-background';
|
||||
|
||||
// Collapse
|
||||
// ---
|
||||
// '@collapse-header-padding': '12px 0 12px 40px';
|
||||
// '@collapse-header-bg': '@background-color-light';
|
||||
// '@collapse-content-padding': '@padding-md';
|
||||
// '@collapse-content-bg': '@component-background';
|
||||
|
||||
|
||||
|
||||
},
|
||||
})(config, env);
|
||||
return config;
|
||||
};
|
|
@ -0,0 +1,25 @@
|
|||
version: '3.5'
|
||||
services:
|
||||
prod-build:
|
||||
container_name: prod-build
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
# - REACT_APP_DOMAIN=http://mobilecorelb-1807532632.ap-southeast-1.elb.amazonaws.com/
|
||||
# - REACT_APP_DOMAIN=https://mobilelink.unioil.com
|
||||
- REACT_APP_DOMAIN=https://mobileapi.unioilapps.com
|
||||
- REACT_APP_PATH=api/cms
|
||||
- REACT_APP_IMG_PATH=unioilQA/
|
||||
restart: always
|
||||
ports:
|
||||
- 8089:80
|
||||
volumes:
|
||||
- '.:/usr/src/app'
|
||||
- '/usr/src/app/node_modules'
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
version: '3.5'
|
||||
services:
|
||||
public-build:
|
||||
container_name: public-build
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- REACT_APP_PUBLIC=true
|
||||
# - PUBLIC_URL=/paypal
|
||||
- REACT_APP_DOMAIN=https://mobileapid.unioil.com
|
||||
- REACT_APP_PATH=api/cms
|
||||
- REACT_APP_IMG_PATH=unioilQA
|
||||
- GENERATE_SOURCEMAP=false
|
||||
restart: always
|
||||
ports:
|
||||
- 8095:80
|
||||
volumes:
|
||||
- '.:/usr/src/app'
|
||||
- '/usr/src/app/node_modules'
|
|
@ -0,0 +1,80 @@
|
|||
version: '3.5'
|
||||
services:
|
||||
test-build:
|
||||
container_name: test-build
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- REACT_APP_DOMAIN=http://192.168.0.68
|
||||
- REACT_APP_PATH=unioilQA/public/index.php/api/cms
|
||||
- REACT_APP_IMG_PATH=unioilQA/
|
||||
restart: always
|
||||
ports:
|
||||
- 8089:80
|
||||
volumes:
|
||||
- '.:/usr/src/app'
|
||||
- '/usr/src/app/node_modules'
|
||||
dev-build:
|
||||
container_name: dev-build
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- REACT_APP_DOMAIN=http://192.168.0.68
|
||||
- REACT_APP_PATH=UniOilLoyaltyApp-BackEnd/public/index.php/api/cms
|
||||
- REACT_APP_IMG_PATH=UniOilLoyaltyApp-BackEnd
|
||||
restart: always
|
||||
ports:
|
||||
- 8081:80
|
||||
volumes:
|
||||
- '.:/usr/src/app'
|
||||
- '/usr/src/app/node_modules'
|
||||
public-dev-build:
|
||||
container_name: public-dev-build
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- REACT_APP_PUBLIC=true
|
||||
- REACT_APP_DOMAIN=http://192.168.0.68
|
||||
- REACT_APP_PATH=UniOilLoyaltyApp-BackEnd/public/index.php/api/cms
|
||||
- REACT_APP_IMG_PATH=UniOilLoyaltyApp-BackEnd/
|
||||
restart: always
|
||||
ports:
|
||||
- 8093:80
|
||||
volumes:
|
||||
- '.:/usr/src/app'
|
||||
- '/usr/src/app/node_modules'
|
||||
public-test-build:
|
||||
container_name: public-test-build
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- REACT_APP_PUBLIC=true
|
||||
- REACT_APP_DOMAIN=http://192.168.0.68
|
||||
- REACT_APP_PATH=unioilQA/public/index.php/api/cms
|
||||
- REACT_APP_IMG_PATH=unioilQA
|
||||
restart: always
|
||||
ports:
|
||||
- 8090:80
|
||||
volumes:
|
||||
- '.:/usr/src/app'
|
||||
- '/usr/src/app/node_modules'
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2015",
|
||||
"baseUrl": "src"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"build",
|
||||
"public",
|
||||
"__test__"
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,278 @@
|
|||
{
|
||||
"posts": [
|
||||
{
|
||||
"id": 1441,
|
||||
"title": "11-json-server",
|
||||
"author": "11-server-deauthor"
|
||||
},
|
||||
{
|
||||
"title": "14-Title",
|
||||
"author": "14-Title Data",
|
||||
"id": 4414
|
||||
},
|
||||
{
|
||||
"title": "tes wafe",
|
||||
"author": "weataewtaew",
|
||||
"id": 1446
|
||||
},
|
||||
{
|
||||
"title": "1-json-server-test",
|
||||
"author": "werewrwe",
|
||||
"id": 1447
|
||||
},
|
||||
{
|
||||
"id": 447,
|
||||
"title": "7-json-server",
|
||||
"author": "7-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 449,
|
||||
"title": "9-json-server",
|
||||
"author": "9-tserver-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 14440,
|
||||
"title": "10-json-server",
|
||||
"author": "10-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 1441,
|
||||
"title": "11-json-server",
|
||||
"author": "11-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 12443,
|
||||
"title": "12-json-server",
|
||||
"author": "12-server-deauthor"
|
||||
},
|
||||
{
|
||||
"title": "tes",
|
||||
"author": "ewrwer",
|
||||
"id": 1334444
|
||||
},
|
||||
{
|
||||
"title": "14-Title",
|
||||
"author": "14-Title Data",
|
||||
"id": 143444
|
||||
},
|
||||
{
|
||||
"title": "fytyiftyfy",
|
||||
"author": "ftftcftc",
|
||||
"id": 15344
|
||||
},
|
||||
{
|
||||
"title": "tes wafe",
|
||||
"author": "weataewtaew",
|
||||
"id": 163444
|
||||
},
|
||||
{
|
||||
"title": "1-json-server-test",
|
||||
"author": "werewrwe",
|
||||
"id": 17344
|
||||
},
|
||||
{
|
||||
"id": 744,
|
||||
"title": "7-json-server",
|
||||
"author": "7-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 944,
|
||||
"title": "9-json-server",
|
||||
"author": "9-tserver-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 104,
|
||||
"title": "10-json-server",
|
||||
"author": "10-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 141,
|
||||
"title": "11-json-server",
|
||||
"author": "11-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 1244,
|
||||
"title": "12-json-server",
|
||||
"author": "12-server-deauthor"
|
||||
},
|
||||
{
|
||||
"title": "tes",
|
||||
"author": "ewrwer",
|
||||
"id": 1344
|
||||
},
|
||||
{
|
||||
"title": "14-Title",
|
||||
"author": "14-Title Data",
|
||||
"id": 1444
|
||||
},
|
||||
{
|
||||
"title": "fytyiftyfy",
|
||||
"author": "ftftcftc",
|
||||
"id": 1544
|
||||
},
|
||||
{
|
||||
"title": "tes wafe",
|
||||
"author": "weataewtaew",
|
||||
"id": 164
|
||||
},
|
||||
{
|
||||
"title": "1-json-server-test",
|
||||
"author": "werewrwe",
|
||||
"id": 1744
|
||||
},
|
||||
{
|
||||
"id": 744,
|
||||
"title": "7-json-server",
|
||||
"author": "7-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 944,
|
||||
"title": "9-json-server",
|
||||
"author": "9-tserver-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 1044,
|
||||
"title": "10-json-server",
|
||||
"author": "10-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 1144,
|
||||
"title": "11-json-server",
|
||||
"author": "11-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 12344,
|
||||
"title": "12-json-server",
|
||||
"author": "12-server-deauthor"
|
||||
},
|
||||
{
|
||||
"title": "tes",
|
||||
"author": "ewrwer",
|
||||
"id": 13344
|
||||
},
|
||||
{
|
||||
"title": "14-Title",
|
||||
"author": "14-Title Data",
|
||||
"id": 14344
|
||||
},
|
||||
{
|
||||
"title": "fytyiftyfy",
|
||||
"author": "ftftcftc",
|
||||
"id": 15344
|
||||
},
|
||||
{
|
||||
"title": "tes wafe",
|
||||
"author": "weataewtaew",
|
||||
"id": 16344
|
||||
},
|
||||
{
|
||||
"title": "1-json-server-test",
|
||||
"author": "werewrwe",
|
||||
"id": 17344
|
||||
},
|
||||
{
|
||||
"id": 744,
|
||||
"title": "7-json-server",
|
||||
"author": "7-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 944,
|
||||
"title": "9-json-server",
|
||||
"author": "9-tserver-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 1044,
|
||||
"title": "10-json-server",
|
||||
"author": "10-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 114444,
|
||||
"title": "11-json-server",
|
||||
"author": "11-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 1244,
|
||||
"title": "12-json-server",
|
||||
"author": "12-server-deauthor"
|
||||
},
|
||||
{
|
||||
"title": "tes",
|
||||
"author": "ewrwer",
|
||||
"id": 1344
|
||||
},
|
||||
{
|
||||
"title": "14-Title",
|
||||
"author": "14-Title Data",
|
||||
"id": 1444
|
||||
},
|
||||
{
|
||||
"title": "fytyiftyfy",
|
||||
"author": "ftftcftc",
|
||||
"id": 1544
|
||||
},
|
||||
{
|
||||
"title": "tes wafe",
|
||||
"author": "weataewtaew",
|
||||
"id": 1644
|
||||
},
|
||||
{
|
||||
"title": "1-json-server-test",
|
||||
"author": "werewrwe",
|
||||
"id": 174
|
||||
},
|
||||
{
|
||||
"id": 744,
|
||||
"title": "7-json-server",
|
||||
"author": "7-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 944,
|
||||
"title": "9-json-server",
|
||||
"author": "9-tserver-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 104,
|
||||
"title": "10-json-server",
|
||||
"author": "10-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 114,
|
||||
"title": "11-json-server",
|
||||
"author": "11-server-deauthor"
|
||||
},
|
||||
{
|
||||
"id": 1234,
|
||||
"title": "12-json-server",
|
||||
"author": "12-server-deauthor"
|
||||
},
|
||||
{
|
||||
"title": "tes",
|
||||
"author": "ewrwer",
|
||||
"id": 1334
|
||||
},
|
||||
{
|
||||
"title": "14-Title",
|
||||
"author": "14-Title Data",
|
||||
"id": 1434
|
||||
},
|
||||
{
|
||||
"title": "fytyiftyfy",
|
||||
"author": "ftftcftc",
|
||||
"id": 15344
|
||||
},
|
||||
{
|
||||
"title": "tes wafe",
|
||||
"author": "weataewtaew",
|
||||
"id": 1634
|
||||
},
|
||||
{
|
||||
"title": "1-json-server-test",
|
||||
"author": "werewrwe",
|
||||
"id": 1734
|
||||
}
|
||||
],
|
||||
"comments": [],
|
||||
"profile": {
|
||||
"name": "typicode"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
"name": "my-app",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "4.0.0",
|
||||
"@react-google-maps/api": "^1.9.7",
|
||||
"antd": "^3.9.1",
|
||||
"antd-input-password": "^0.3.0",
|
||||
"axios": "^0.18.0",
|
||||
"crypto-js": "^3.1.9-1",
|
||||
"dsbridge": "^3.1.3",
|
||||
"filesize": "^3.6.1",
|
||||
"formik": "^1.2.0",
|
||||
"history": "^4.7.2",
|
||||
"js-file-download": "^0.4.4",
|
||||
"libsodium-wrappers": "^0.7.3",
|
||||
"moment": "^2.27.0",
|
||||
"query-string": "^5.1.1",
|
||||
"react": "^16.7.0",
|
||||
"react-copy-to-clipboard": "^5.0.1",
|
||||
"react-csv": "^2.0.3",
|
||||
"react-csv-reader": "^3.1.0",
|
||||
"react-device-detect": "^1.6.1",
|
||||
"react-dom": "^16.5.0",
|
||||
"react-geocode": "^0.2.1",
|
||||
"react-google-autocomplete": "^1.2.6",
|
||||
"react-google-map": "^3.1.1",
|
||||
"react-google-maps": "^9.4.5",
|
||||
"react-helmet": "^5.2.0",
|
||||
"react-idle-timer": "^4.0.9",
|
||||
"react-input-mask": "^2.0.4",
|
||||
"react-loadable": "^5.5.0",
|
||||
"react-papaparse": "^3.7.1",
|
||||
"react-redux": "^5.0.7",
|
||||
"react-router-dom": "^4.2.2",
|
||||
"react-router-redux": "^4.0.8",
|
||||
"react-scripts": "^5.0.1",
|
||||
"redux": "^4.0.0",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-saga": "^0.16.0",
|
||||
"styled-components": "^3.4.5",
|
||||
"universal-cookie": "3.0.4",
|
||||
"yup": "^0.26.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-app-rewired start",
|
||||
|
||||
"test": "react-app-rewired test --env=jsdom",
|
||||
"eject": "react-app-rewired eject",
|
||||
"dev": "docker-compose up -d --build",
|
||||
"dev:stop": "docker-compose down",
|
||||
"prod": "docker-compose -f docker-compose-prod.yml up -d --build",
|
||||
"prod:stop": "docker-compose -f docker-compose-prod.yml down",
|
||||
"flow": "flow",
|
||||
"build": "react-scripts build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-import": "^1.7.0",
|
||||
"debug": "^3.1.0",
|
||||
"flow-bin": "0.80.0",
|
||||
"less-plugin-variables-output": "^1.2.0",
|
||||
"react-app-rewire-less": "^2.1.3",
|
||||
"react-app-rewired": "^1.6.2",
|
||||
"vite": "^6.2.5"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 17 KiB |
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="theme-color" content="#000000">
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is added to the
|
||||
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon_unioil.ico">
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
You need to enable JavaScript to run this app.
|
||||
</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
<script type="text/javascript">
|
||||
|
||||
// For Adroid
|
||||
//window.AndroidTopUpSuccess = AndroidTopUpFailed;
|
||||
window.AndroidTopUpFailed = AndroidTopUpFailed;
|
||||
|
||||
// For iOS
|
||||
window.iOStopUpSuccess = iOStopUpSuccess;
|
||||
window.iOStopUpFailed = iOStopUpFailed;
|
||||
|
||||
function AndroidTopUpFailed() {
|
||||
// For Adroid
|
||||
AndroidInterface.returnTopUpPage();
|
||||
|
||||
}
|
||||
|
||||
function iOStopUpSuccess() {
|
||||
//alert('top up success ' );
|
||||
// For iOS
|
||||
window.webkit.messageHandlers.backToHomePage.postMessage({'ButtonId':'clickMeButton'})
|
||||
}
|
||||
|
||||
function iOStopUpFailed() {
|
||||
//alert('back to top up' );
|
||||
// For iOS
|
||||
window.webkit.messageHandlers.backToTopUp.postMessage({'ButtonId':'clickMeButton'})
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon_unioil.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
}
|
||||
],
|
||||
"start_url": "./index.html",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
|
@ -0,0 +1,215 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import { BrowserRouter as Router, Route, Redirect, Switch, withRouter } from 'react-router-dom';
|
||||
import Loadable from 'react-loadable';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import LoginLayoutRoute from './components/Login/Routes';
|
||||
import DashboardRoute from './components/Dashboard/Routes';
|
||||
import Loading from './components/Loading';
|
||||
|
||||
import { getCookie } from './utils/cookie';
|
||||
import { customAction } from './actions';
|
||||
import { API_UNI_OIL, API_POST } from 'utils/Api';
|
||||
|
||||
const AsyncLogin = Loadable({
|
||||
loader: () => import('./containers/public/Login'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncRegistration = Loadable({
|
||||
loader: () => import('./containers/public/Registration'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncChangePassword = Loadable({
|
||||
loader: () => import('./containers/public/ChangePassword'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncPublicTopSuccessPage = Loadable({
|
||||
loader: () => import('./containers/public/PublicTopSuccessPage'),
|
||||
loading: () => {
|
||||
return null;
|
||||
},
|
||||
});
|
||||
|
||||
const AsyncPublicTopErrorPage = Loadable({
|
||||
loader: () => import('./containers/public/PublicTopErrorPage'),
|
||||
loading: () => {
|
||||
return null;
|
||||
},
|
||||
});
|
||||
|
||||
const AsyncMyProfile = Loadable({
|
||||
loader: () => import('./containers/private/MyProfile'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncNotification = Loadable({
|
||||
loader: () => import('./containers/private/Notifications'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncUserManagement = Loadable({
|
||||
loader: () => import('./containers/private/UserManagement'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncMemberManagement = Loadable({
|
||||
loader: () => import('./containers/private/MemberManagement'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncPhotoSlider = Loadable({
|
||||
loader: () => import('./containers/private/HomePage/PhotoSlider'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncPromotions = Loadable({
|
||||
loader: () => import('./containers/private/Promotions'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncTopUp = Loadable({
|
||||
loader: () => import('./containers/private/TopUp'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncCardTypes = Loadable({
|
||||
loader: () => import('./containers/private/AboutUs'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncReports = Loadable({
|
||||
loader: () => import('./containers/private/Reports'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncSystemPreferences = Loadable({
|
||||
loader: () => import('./containers/private/SystemPreferences'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AsyncPage404 = Loadable({
|
||||
loader: () => import('./components/PageError/404'),
|
||||
loading: Loading,
|
||||
});
|
||||
const AsyncLocator = Loadable({
|
||||
loader: () => import('./containers/private/StationLocator/Location'),
|
||||
loading: Loading,
|
||||
});
|
||||
const AsyncBranches = Loadable({
|
||||
loader: () => import('./containers/private/StationLocator/Branches'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
const AsyncFuels = Loadable({
|
||||
loader: () => import('./containers/private/StationLocator/Fuels'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
const CaptureRouteNotFound = withRouter(({ children, location }) => {
|
||||
return location && location.state && location.state.pageNotFound ? <AsyncPage404 /> : children;
|
||||
});
|
||||
|
||||
const publicRoutes = [
|
||||
'/',
|
||||
'/login',
|
||||
'/registration',
|
||||
'/forgot-password',
|
||||
'/change-password',
|
||||
'/topup-success-page',
|
||||
'/topup-error-page',
|
||||
];
|
||||
|
||||
class App extends Component {
|
||||
state = {
|
||||
accessAuth: false,
|
||||
mounting: true,
|
||||
};
|
||||
|
||||
componentDidMount = async () => {
|
||||
if (getCookie('TOKEN')) {
|
||||
let { history, customAction } = this.props;
|
||||
let { replace, location } = history;
|
||||
|
||||
API_UNI_OIL.defaults.headers.common['Authorization'] = `Bearer ${getCookie('TOKEN').token}`;
|
||||
//customAction({type: 'LOGIN_SUCCESS' });
|
||||
|
||||
try {
|
||||
let response = await API_POST(`adminProfile`);
|
||||
response.data.data['userInfo'] = { ...response.data.data };
|
||||
|
||||
customAction({
|
||||
type: 'LOGIN_SUCCESS',
|
||||
payload: { ...response.data.data },
|
||||
});
|
||||
} catch ({ response: error }) {
|
||||
//notification.error({ message: "Error", description: "Something went wrong loading user data." , duration: 20, });
|
||||
}
|
||||
|
||||
if (publicRoutes.includes(location.pathname)) replace('/user-management');
|
||||
}
|
||||
this.setState({ mounting: false });
|
||||
};
|
||||
|
||||
render() {
|
||||
console.log('====================================');
|
||||
console.log(process.env.REACT_APP_API, process.env.REACT_APP_IMG_URL, process.env.REACT_APP_PUBLIC, 'API LIST!!!');
|
||||
console.log('====================================');
|
||||
if (this.state.mounting) return null;
|
||||
|
||||
if (process.env.REACT_APP_PUBLIC === 'false') {
|
||||
return (
|
||||
<Router>
|
||||
<Switch>
|
||||
<Redirect exact from='/' to='/login' />
|
||||
<LoginLayoutRoute exact path='/login' component={AsyncLogin} />
|
||||
<LoginLayoutRoute exact path='/registration' component={AsyncRegistration} />
|
||||
<LoginLayoutRoute exact path='/change-password' component={AsyncChangePassword} />
|
||||
{/* PRIVATE ROUTES */}
|
||||
<DashboardRoute path='/user-management' component={AsyncUserManagement} />
|
||||
<DashboardRoute path='/notifications' component={AsyncNotification} />
|
||||
<DashboardRoute path='/member-management' component={AsyncMemberManagement} />
|
||||
<DashboardRoute path='/home-page' component={AsyncPhotoSlider} />
|
||||
<DashboardRoute path='/promotions' component={AsyncPromotions} />
|
||||
<DashboardRoute path='/top-up' component={AsyncTopUp} />
|
||||
<DashboardRoute path='/about-us' component={AsyncCardTypes} />
|
||||
<DashboardRoute path='/reports' component={AsyncReports} />
|
||||
<DashboardRoute path='/stations' component={AsyncLocator}/>
|
||||
<DashboardRoute path='/branches' component={AsyncBranches}/>
|
||||
<DashboardRoute path='/fuels' component={AsyncFuels} />
|
||||
<DashboardRoute path='/system-parameters' component={AsyncSystemPreferences} />
|
||||
<DashboardRoute path='/my-profile' component={AsyncMyProfile} />
|
||||
<Route exact path='/topup-success-page' component={AsyncPublicTopSuccessPage} />
|
||||
<Route exact path='/topup-error-page' component={AsyncPublicTopErrorPage} />
|
||||
<Route exact path='/404' component={AsyncPage404} />
|
||||
<DashboardRoute path='*' component={AsyncPage404} />
|
||||
</Switch>
|
||||
</Router>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<Router>
|
||||
<Switch>
|
||||
<Redirect exact from='/' to='/topup-success-page' />
|
||||
<Redirect exact from='/login' to='/topup-success-page' />
|
||||
<Route exact path='/topup-success-page' component={AsyncPublicTopSuccessPage} />
|
||||
<Route exact path='/topup-error-page' component={AsyncPublicTopErrorPage} />
|
||||
<Route exact path='/404' component={AsyncPage404} />
|
||||
<DashboardRoute path='*' component={AsyncPage404} />
|
||||
</Switch>
|
||||
</Router>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
App = connect(
|
||||
(state) => ({
|
||||
isAuthenticated: state.auth.isAuthenticated,
|
||||
}),
|
||||
{ customAction }
|
||||
)(App);
|
||||
|
||||
export default withRouter(App);
|
|
@ -0,0 +1,9 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<App />, div);
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
});
|
After Width: | Height: | Size: 224 KiB |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 57.834 57.955"><defs><style>.a{fill:#f4825c;stroke:#707070;}.b{fill:#e74610;}.c{stroke:none;}.d{fill:none;}</style></defs><g transform="translate(-0.498 0.199)"><g transform="translate(0 0)"><g class="a" transform="translate(1.009 0.934)"><circle class="c" cx="27.989" cy="27.989" r="27.989"/><circle class="d" cx="27.989" cy="27.989" r="27.489"/></g><g transform="translate(-26.502 -27.6)"><g transform="translate(27 27.4)"><path class="b" d="M55.917,85.355A28.978,28.978,0,1,1,84.834,56.317,29.012,29.012,0,0,1,55.917,85.355Zm0-54.31A25.272,25.272,0,1,0,81.189,56.317,25.253,25.253,0,0,0,55.917,31.045Z" transform="translate(-27 -27.4)"/><g transform="translate(18.529 18.65)"><path class="b" d="M59.638,63.344a1.827,1.827,0,0,1-1.337-.486l-8.5-8.5a1.762,1.762,0,0,1,0-2.551l8.5-8.5a1.8,1.8,0,0,1,2.551,2.551l-7.168,7.168,7.168,7.169a1.762,1.762,0,0,1,0,2.551A1.234,1.234,0,0,1,59.638,63.344Z" transform="translate(-40.745 -42.75)"/><path class="b" d="M44.133,63.323a1.827,1.827,0,0,1-1.336-.486,1.762,1.762,0,0,1,0-2.551l7.169-7.169L42.8,45.948A1.8,1.8,0,0,1,45.348,43.4l8.5,8.5a1.762,1.762,0,0,1,0,2.551l-8.5,8.5A1.814,1.814,0,0,1,44.133,63.323Z" transform="translate(-42.25 -42.729)"/></g></g></g></g></g></svg>
|
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 58.184 58.184"><defs><style>.a{fill:#56b68b;stroke:#707070;}.b{fill:#018952;fill-rule:evenodd;}.c{stroke:none;}.d{fill:none;}</style></defs><g transform="translate(-138.502 -248.613)"><g transform="translate(138.502 248.613)"><g transform="translate(0 0)"><g class="a" transform="translate(1.009 0.934)"><circle class="c" cx="27.989" cy="27.989" r="27.989"/><circle class="d" cx="27.989" cy="27.989" r="27.489"/></g><path class="b" d="M47.664,22.747l2.3,2.3L31.8,43.209l-2.3,2.3-2.3-2.3-8.978-8.978,2.3-2.3L29.5,40.913ZM34.092,5A29.092,29.092,0,1,1,5,34.092,29.079,29.079,0,0,1,34.092,5Zm0,3.967A25.16,25.16,0,1,1,8.967,34.092,25.173,25.173,0,0,1,34.092,8.967Z" transform="translate(-5 -5)"/></g></g></g></svg>
|
After Width: | Height: | Size: 763 B |
After Width: | Height: | Size: 8.1 KiB |
|
@ -0,0 +1,69 @@
|
|||
import React, { Component } from 'react';
|
||||
//import { Field, reduxForm } from 'redux-form';
|
||||
import { Form, Row, Col, Button, Icon, Input,Select } from 'antd';
|
||||
|
||||
import { required } from 'constants/validation';
|
||||
import {AInput,ASelect,ARangePicker} from './AntdForms'
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const { Option } = Select;
|
||||
|
||||
class AdvancedSearchForm extends Component {
|
||||
render() {
|
||||
|
||||
const { handleSubmit,onSubmit, reset } = this.props;
|
||||
|
||||
return (
|
||||
<Form
|
||||
onSubmit={onSubmit}
|
||||
className="login-form"
|
||||
>
|
||||
<Row gutter={24}>
|
||||
<Col span={8}>
|
||||
{/* <Field
|
||||
name="filter_field"
|
||||
label="Filter by Code"
|
||||
component={ASelect}
|
||||
validate={required}
|
||||
defaultValue="1"
|
||||
>
|
||||
<Option value="ff0000">Red</Option>
|
||||
<Option value="00ff00">Green</Option>
|
||||
<Option value="0000ff">Blue</Option>
|
||||
</Field> */}
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
{/* <Field
|
||||
name="filter_value"
|
||||
label="Filter by Name"
|
||||
component={ARangePicker}
|
||||
width={4}
|
||||
placeholder={["From", "To"]}
|
||||
hasFeedback
|
||||
onFocus={e => e.preventDefault()}
|
||||
onBlur={e => e.preventDefault()}
|
||||
// validate={required}
|
||||
/> */}
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col span={24} style={{ textAlign: 'right' }}>
|
||||
<Button type="primary" htmlType="submit">Search</Button>
|
||||
<Button style={{ marginLeft: 8 }} onClick={reset}>
|
||||
Clear
|
||||
</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// AdvancedSearchForm = reduxForm({
|
||||
// form: "CreateEmployeeFieldsForm",
|
||||
// })(AdvancedSearchForm);
|
||||
|
||||
export default AdvancedSearchForm;
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
import React from "react";
|
||||
import { Form, Input, Radio, Select, Checkbox, Button, DatePicker } from "antd";
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const RadioGroup = Radio.Group;
|
||||
const { Option } = Select;
|
||||
const { TextArea } = Input;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
const formItemLayout = {
|
||||
// labelCol: {
|
||||
// xs: { span: 24 },
|
||||
// sm: { span: 7 }
|
||||
// },
|
||||
// wrapperCol: {
|
||||
// xs: { span: 24 },
|
||||
// sm: { span: 14 }
|
||||
// }
|
||||
};
|
||||
|
||||
|
||||
|
||||
const makeField = Component => ({ input, meta, children, hasFeedback, label, ...rest }) => {
|
||||
const hasError = meta.touched && meta.invalid;
|
||||
const inputs = {...input};
|
||||
const rests = {...rest};
|
||||
console.log(inputs,'inputss', rests , 'ressttss')
|
||||
return (
|
||||
<FormItem
|
||||
{...formItemLayout}
|
||||
label={label}
|
||||
validateStatus={hasError ? "error" : "success"}
|
||||
hasFeedback={hasFeedback && hasError}
|
||||
help={hasError && meta.error}
|
||||
>
|
||||
<Component {...input} {...rest} children={children} />
|
||||
</FormItem>
|
||||
);
|
||||
};
|
||||
|
||||
export const AInput = makeField(Input);
|
||||
export const ARadioGroup = makeField(RadioGroup);
|
||||
export const ASelect = makeField(Select);
|
||||
export const ACheckbox = makeField(Checkbox);
|
||||
export const ATextarea = makeField(TextArea);
|
||||
export const ARangePicker = makeField(RangePicker);
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Form, Cascader } from 'antd';
|
||||
import { fetchData } from 'utils/Api';
|
||||
const FormItem = Form.Item;
|
||||
|
||||
const options = [{
|
||||
value: 'zhejiang',
|
||||
label: 'Zhejiang',
|
||||
children: [{
|
||||
value: 'hangzhou',
|
||||
label: 'Hangzhou',
|
||||
children: [{
|
||||
value: 'xihu',
|
||||
label: 'West Lake',
|
||||
}],
|
||||
}],
|
||||
}, {
|
||||
value: 'jiangsu',
|
||||
label: 'Jiangsu',
|
||||
children: [{
|
||||
value: 'nanjing',
|
||||
label: 'Nanjing',
|
||||
children: [{
|
||||
value: 'zhonghuamen',
|
||||
label: 'Zhong Hua Men',
|
||||
}],
|
||||
}],
|
||||
}];
|
||||
|
||||
class CascaderForm extends Component {
|
||||
async componentDidMount() {
|
||||
const { url } = this.props;
|
||||
const response = await fetchData(url);
|
||||
this.setState({
|
||||
options: response.data.data
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
field: { name, /* ...field */ },
|
||||
form: { errors, setFieldValue, /* ...form */ },
|
||||
layout,
|
||||
label,
|
||||
required,
|
||||
...props
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<FormItem
|
||||
{...layout}
|
||||
required={required}
|
||||
label={label}
|
||||
validateStatus={errors[name] && 'error'}
|
||||
help={errors[name]}
|
||||
>
|
||||
<Cascader
|
||||
{...props}
|
||||
onChange={this.handleChange = (value) => { setFieldValue(name, value) }}
|
||||
options={options}
|
||||
/>
|
||||
</FormItem>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CascaderForm;
|
|
@ -0,0 +1,55 @@
|
|||
import React from 'react';
|
||||
import { Checkbox, Form } from 'antd';
|
||||
const FormItem = Form.Item;
|
||||
|
||||
const CheckboxForm = ({
|
||||
field: { name, ...field },
|
||||
form: { touched, errors, handleChange, setFieldValue, ...form },
|
||||
label,
|
||||
inline,
|
||||
layout,
|
||||
required,
|
||||
...props
|
||||
}) => {
|
||||
|
||||
if (inline) {
|
||||
return (
|
||||
<Checkbox
|
||||
{...props}
|
||||
{...field}
|
||||
name={name}
|
||||
type="checkbox"
|
||||
checked={field.value}
|
||||
onChange={this.handleChange = (value) => { setFieldValue(name, !field.value) }}
|
||||
>
|
||||
{label}
|
||||
</Checkbox>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<FormItem
|
||||
{...layout}
|
||||
required={required}
|
||||
style={{marginBottom: '10px',marginLeft: '20.9%'}}
|
||||
validateStatus={touched[name] && errors[name] && 'error'}
|
||||
help={touched[name] && errors[name]}
|
||||
>
|
||||
<Checkbox
|
||||
{...props}
|
||||
{...field}
|
||||
|
||||
name={name}
|
||||
type="checkbox"
|
||||
checked={field.value}
|
||||
onChange={this.handleChange = (value) => { setFieldValue(name, !field.value) }}
|
||||
>
|
||||
{label}
|
||||
</Checkbox>
|
||||
</FormItem>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
export default CheckboxForm;
|
|
@ -0,0 +1,160 @@
|
|||
import React from 'react';
|
||||
import { Form, DatePicker } from 'antd';
|
||||
import moment from 'moment'
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
const DatePickerForm = ({
|
||||
field: { ...field },
|
||||
form: { touched, errors, handleSubmit, setFieldValue, handlePanelChange, ...form },
|
||||
type,
|
||||
layout,
|
||||
label,
|
||||
format,
|
||||
minDateToday,
|
||||
required,
|
||||
disabledDateStart,
|
||||
dateStartEnd,
|
||||
disabledDateStartEndPhotoSlider,
|
||||
disabledDateStartEndPhotoSliderEndDate,
|
||||
isEdit,
|
||||
isAutoFill,
|
||||
...props
|
||||
}) => {
|
||||
|
||||
const onDateChange = (value, isDateRange = false) => {
|
||||
|
||||
value && setFieldValue(field.name, isDateRange
|
||||
? [value[0].format(format), value[1].format(format)]
|
||||
: value.format(format)
|
||||
)
|
||||
|
||||
|
||||
if(value == null) {
|
||||
setFieldValue(field.name, isDateRange
|
||||
? [value[0].format(format), value[1].format(format)]
|
||||
: null
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Disable date less than `Today`
|
||||
// use minDateToday props
|
||||
// const disabledDate = (current) => {
|
||||
// if (minDateToday) {
|
||||
// var oneDay = (1 * 24 * 60 * 60 * 1000);
|
||||
// return current && (current.valueOf() < (Date.now() - oneDay));
|
||||
// }
|
||||
// }
|
||||
|
||||
const disabledDate = (current) => {
|
||||
// Can not select days before today and today
|
||||
|
||||
// for promotions
|
||||
if(disabledDateStart && !disabledDateStartEndPhotoSlider) {
|
||||
if(form.values.date_start) {
|
||||
return current && current < moment(form.values.date_start);
|
||||
} else {
|
||||
//return current && moment(current).add(2,'days') < moment().endOf('day').add(2,'days');
|
||||
}
|
||||
}
|
||||
// for photo slider Date Start
|
||||
if(disabledDateStartEndPhotoSlider && !disabledDateStartEndPhotoSliderEndDate) {
|
||||
if(dateStartEnd) {
|
||||
if(current && current.format() < moment(dateStartEnd.date_start).format()) {
|
||||
if(isEdit) {
|
||||
//return current && current.format() < moment(dateStartEnd.date_start).subtract(1,'days').format()
|
||||
}
|
||||
return current && current.format() < moment(dateStartEnd.date_start).format()
|
||||
} else {
|
||||
if(isEdit) {
|
||||
return current && current.format() > moment(dateStartEnd.date_end).format();
|
||||
}
|
||||
//return current && current.format() > moment(dateStartEnd.date_end).add(1,'days').format();
|
||||
return current && current.format() > moment(dateStartEnd.date_end).format();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for photo slider date End
|
||||
if(disabledDateStartEndPhotoSliderEndDate) {
|
||||
if(dateStartEnd) {
|
||||
if(current && current.format() < form.values.date_start) {
|
||||
// disabled previous date
|
||||
return current && current < moment(form.values.date_start);
|
||||
} else {
|
||||
// diabled past date
|
||||
if(isEdit) {
|
||||
return current && current.format() > moment(dateStartEnd.date_end).format();
|
||||
}
|
||||
//return current && current.format() > moment(dateStartEnd.date_end).add(1,'days').format();
|
||||
return current && current.format() > moment(dateStartEnd.date_end).format();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(disabledDateStart) {
|
||||
if(dateStartEnd) {
|
||||
// return
|
||||
} else {
|
||||
if(form.values.date_start) {
|
||||
return current && current < moment(form.values.date_start);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let _props = {...props}; let _field = {...field};
|
||||
|
||||
|
||||
if(_field.value !== "") {
|
||||
_props.value = _field.value && moment(_field.value,format)
|
||||
}
|
||||
|
||||
return (
|
||||
<FormItem
|
||||
{...layout}
|
||||
required={required}
|
||||
label={label}
|
||||
style={{marginBottom: '10px'}}
|
||||
validateStatus={touched[field.name] && errors[field.name] && 'error'}
|
||||
help={touched[field.name] && errors[field.name]}
|
||||
>
|
||||
{ type === 'date' &&
|
||||
<DatePicker
|
||||
{..._props}
|
||||
onChange={(value) => onDateChange(value)}
|
||||
format={format}
|
||||
disabledDate={disabledDateStartEndPhotoSlider || disabledDateStart ? disabledDate : ()=> { return false } }
|
||||
style={{width: '250px'}}
|
||||
/>
|
||||
}
|
||||
|
||||
{ type === 'date-time' &&
|
||||
<DatePicker
|
||||
showTime={true}
|
||||
{..._props}
|
||||
onChange={(value) => onDateChange(value)}
|
||||
format={format}
|
||||
style={{width: '250px'}}
|
||||
/>
|
||||
}
|
||||
|
||||
{ type === 'range' &&
|
||||
<RangePicker
|
||||
{...props}
|
||||
onChange={(value) => onDateChange(value, true)}
|
||||
format={format}
|
||||
disabledDate={disabledDate}
|
||||
/>
|
||||
}
|
||||
</FormItem>
|
||||
);
|
||||
};
|
||||
|
||||
export default DatePickerForm;
|
|
@ -0,0 +1,145 @@
|
|||
|
||||
import React, { Component } from 'react';
|
||||
import { Button,Popconfirm, Icon, Dropdown, Menu } from 'antd';
|
||||
|
||||
|
||||
class HeaderForm extends Component {
|
||||
|
||||
|
||||
confirm(action) {
|
||||
action();
|
||||
// message.success('Click on Yes');
|
||||
}
|
||||
|
||||
cancel(e) {
|
||||
// console.log(e);
|
||||
// message.error('Click on No');
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { action, cancel, deleteAction , title , actionBtnName, cancelBtnName,
|
||||
deleteBtnName, loading, withConfirm, styleBtn, isDropDown , actionPrivacy,
|
||||
actionTerms, disabled, withCancelConfirm, isInsideForm } = this.props;
|
||||
|
||||
const menu = (
|
||||
<Menu className="terms-management"
|
||||
//onClick={handleMenuClick}
|
||||
>
|
||||
<Menu.Item key="1" onClick={actionPrivacy}>{`Terms & Condition`}</Menu.Item>
|
||||
<Menu.Item key="2" onClick={actionTerms}>Privacy Policy</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
return (
|
||||
<div style={{display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
borderBottom: '1px solid #E6ECF5',
|
||||
background: '#fff',
|
||||
position: 'fixed', width: '100%',
|
||||
padding: '0px 24px 5px', zIndex: 99,
|
||||
marginTop: isInsideForm == true ? '-154px' : '-73px' , marginLeft: '-17px' }}
|
||||
>
|
||||
<h1 style={{fontSize: '24px'}}>{title}</h1>
|
||||
<div style={{display: 'flex', position: 'fixed', right: '24px'}}>
|
||||
{
|
||||
action &&
|
||||
<div>
|
||||
{
|
||||
withConfirm
|
||||
?
|
||||
(
|
||||
<Popconfirm
|
||||
placement="bottom"
|
||||
onConfirm={()=>this.confirm(action)}
|
||||
onCancel={this.cancel} okText="Yes" cancelText="No"
|
||||
title={withConfirm && withConfirm.message}
|
||||
>
|
||||
<Button
|
||||
disabled={disabled}
|
||||
loading={loading}
|
||||
style={{ margin: '0 4px', width: '135px',
|
||||
display: 'block', background: '#E74610', borderColor:'#E74610',
|
||||
color: '#fff' ,
|
||||
opacity: disabled ? 0.5 : 'initial'
|
||||
}}
|
||||
>
|
||||
{actionBtnName}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
) :
|
||||
!isDropDown && (
|
||||
<Button
|
||||
loading={loading}
|
||||
onClick={action}
|
||||
disabled={disabled}
|
||||
style={{
|
||||
margin: '0 4px', width: '135px', display: 'block',
|
||||
background: styleBtn ? styleBtn.background : '#E74610',
|
||||
borderColor: styleBtn ? styleBtn.borderColor : '#E74610',
|
||||
color: styleBtn ? styleBtn.color : '#fff',
|
||||
opacity: disabled ? 0.5 : 'initial'
|
||||
}}
|
||||
>
|
||||
{actionBtnName}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
|
||||
}
|
||||
{
|
||||
cancel &&
|
||||
<Popconfirm
|
||||
placement="bottomRight"
|
||||
onConfirm={cancel}
|
||||
onCancel={null} okText="Yes" cancelText="No"
|
||||
title={withCancelConfirm && withCancelConfirm.message}
|
||||
>
|
||||
<Button
|
||||
loading={loading}
|
||||
onClick={withCancelConfirm ? null : cancel}
|
||||
style={{ margin: '0 4px', width: '135px', display: 'block', background: 'white', borderColor:'#b8bbc9', color: '#65697f' }}
|
||||
>
|
||||
{cancelBtnName}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
}
|
||||
{
|
||||
deleteAction &&
|
||||
(
|
||||
<Popconfirm
|
||||
placement="bottom" title={'Are you sure you want to delete this record?'}
|
||||
onConfirm={deleteAction} okText="Yes" cancelText="No"
|
||||
icon={ <Icon type="close-circle" /> }
|
||||
>
|
||||
<Button
|
||||
disabled={disabled}
|
||||
type="danger"
|
||||
loading={loading}
|
||||
style={{ margin: '0 4px', width: '135px', display: 'block', background: 'white', borderColor:'#b8bbc9', color: '#65697f' }}
|
||||
>
|
||||
{deleteBtnName}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
)
|
||||
}
|
||||
{
|
||||
isDropDown && (
|
||||
<div style={{position: 'relative'}} className="terms-management-parent">
|
||||
<Dropdown overlay={menu} className="terms-management">
|
||||
<Button disabled={disabled}>
|
||||
Add <Icon type="down" />
|
||||
</Button>
|
||||
</Dropdown>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default HeaderForm;
|
|
@ -0,0 +1,37 @@
|
|||
import * as React from 'react';
|
||||
import { Form, Icon, Input, Row, Col, Button } from 'antd';
|
||||
import ReactInputMask from 'react-input-mask';
|
||||
|
||||
const FormItem = Form.Item;
|
||||
|
||||
const InputNumberForm = ({
|
||||
field: { ...field },
|
||||
form: { touched, errors, ...form },
|
||||
required,
|
||||
icon,
|
||||
layout,
|
||||
withActionBtn,
|
||||
action,
|
||||
loading,
|
||||
mask,
|
||||
...props
|
||||
}) => {
|
||||
return (
|
||||
<FormItem
|
||||
{...layout}
|
||||
required={required}
|
||||
label={props.label}
|
||||
style={{marginBottom: '10px'}}
|
||||
validateStatus={touched[field.name] && errors[field.name] && 'error'}
|
||||
help={touched[field.name] && errors[field.name]}
|
||||
>
|
||||
<ReactInputMask {...props}
|
||||
className="ant-input"
|
||||
{...field} mask={mask} maskChar=" "
|
||||
/>
|
||||
|
||||
</FormItem>
|
||||
);
|
||||
};
|
||||
|
||||
export default InputNumberForm;
|