initial commit

parents
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
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
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}"
* 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
*.log
.DS_Store
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
/.fleet
/.idea
/.nova
/.phpunit.cache
/.vscode
/.zed
/auth.json
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
Homestead.json
Homestead.yaml
Thumbs.db
/public/laravolt
/build/coverage
/phpunit-coverage-result.xml
/phpunit-execution-result.xml
# My Awesome Laravolt Application
## Server Requirements
1. PHP 8.4
1. Composer 2
1. SQLite, PostgreSQL, MySQL or MariaDB
## Local Setup
1. Clone repository
1. Jalankan `composer install`
1. Jalankan `cp .env.example .env`
1. Sesuaikan konfigurasi database dan lain-lain
1. Jalankan `php artisan key:generate`
1. Jalankan `php artisan migrate:fresh --seed`
1. Jalankan `php artisan laravolt:link`
1. Jalankan `php artisan vendor:publish --tag=laravolt-assets`
1. Pastikan folder-folder berikut _writeable_:
1. `bootstrap/cache`
1. `storage`
1. php artisan laravolt:admin Administrator admin@laravolt.dev secret
<?php
namespace App\Enums;
use BenSampo\Enum\Enum;
/**
* @extends Enum<string>
*/
final class Permission extends Enum
{
// sample permission
// const POST_MANAGE = 'post.manage';
}
<?php
namespace App\Enums;
use BenSampo\Enum\Enum;
/**
* @extends Enum<string>
*/
final class UserStatus extends Enum
{
const PENDING = 'PENDING';
const ACTIVE = 'ACTIVE';
const BLOCKED = 'BLOCKED';
}
<?php
namespace App\Http\Controllers\Auth;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Str;
class ForgotPasswordController extends Controller
{
/**
* Display the form to request a password reset link.
*
* @return \Illuminate\Contracts\View\View
*/
public function show()
{
return view('auth.forgot');
}
/**
* Send a reset link to the given user.
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate(['email' => ['required', 'email', 'exists:users']]);
$response = Password::INVALID_USER;
$user = User::whereEmail($request->email)->first();
if ($user) {
$response = app('laravolt.password')->sendResetLink($user);
}
if ($response === Password::RESET_LINK_SENT && $user) {
$email = $user->getEmailForPasswordReset();
return redirect()
->route('auth::forgot.show')
->with('success', trans($response, ['email' => $email, 'emailMasked' => Str::maskEmail($email)]));
}
return redirect()
->route('auth::forgot.show')
->with('error', ['email' => trans($response)]);
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Requests\Auth\LoginRequest;
use Illuminate\Routing\Controller;
class LoginController extends Controller
{
/**
* Display the login view.
*
* @return \Illuminate\Contracts\View\View
*/
public function show()
{
return view('auth.login');
}
/**
* Handle an incoming authentication request.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function store(LoginRequest $request)
{
$request->authenticate();
$request->session()->regenerate();
return redirect()->intended(\App\Providers\AppServiceProvider::HOME);
}
}
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class Logout
{
public function __invoke(Request $request): RedirectResponse
{
Auth::guard('web')->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect('/');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Models\User;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
class RegistrationController extends Controller
{
/**
* Display the registration view.
*
* @return \Illuminate\Contracts\View\View
*/
public function show()
{
return view('auth.register');
}
/**
* Handle an incoming registration request.
*
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request)
{
$request->validate([
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|confirmed|min:8',
]);
/** @var string $password */
$password = $request->password;
Auth::login(
$user = User::query()->create([
'name' => $request->name,
'email' => $request->email,
'password' => Hash::make($password),
'status' => 'ACTIVE',
])
);
if (config('laravolt.platform.features.verification') === false) {
$user->markEmailAsVerified();
}
event(new Registered($user));
return redirect(\App\Providers\AppServiceProvider::HOME)
->with('success', __('Your account successfully created'));
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Str;
class ResetPasswordController extends Controller
{
/**
* Display the password reset view.
*
* @return \Illuminate\Contracts\View\View
*/
public function show(Request $request, ?string $token = null)
{
return view('auth.reset', ['token' => $token]);
}
/**
* Handle an incoming new password request.
*
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request)
{
$request->validate(
[
'token' => 'required',
'email' => 'required|email',
'password' => 'required|string|confirmed|min:8',
]
);
/** @var string $password */
$password = $request->password;
// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// database. Otherwise we will parse the error and return the response.
/** @var string $status */
$status = Password::reset(
$request->only('email', 'password', 'password_confirmation', 'token'),
function ($user) use ($password) {
$attributes = [
'password' => Hash::make($password),
'remember_token' => Str::random(60),
];
$user->forceFill($attributes)->save();
event(new PasswordReset($user));
}
);
// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
return $status == Password::PASSWORD_RESET
? redirect()->route('auth::login.show')->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Providers\AppServiceProvider;
use Illuminate\Auth\Events\Verified;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\EmailVerificationRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Controller;
use function PHPUnit\Framework\assertInstanceOf;
class VerificationController extends Controller
{
public function show(): View|RedirectResponse
{
/** @var MustVerifyEmail $user */
$user = auth()->user();
if ($user->hasVerifiedEmail()) {
return redirect()->intended(AppServiceProvider::HOME);
}
return view('auth.verify-email');
}
public function store(): RedirectResponse
{
/** @var MustVerifyEmail $user */
$user = auth()->user();
assertInstanceOf(MustVerifyEmail::class, $user);
return $this->handle($user);
}
public function update(EmailVerificationRequest $request): RedirectResponse
{
/** @var MustVerifyEmail $user */
$user = auth()->user();
if ($user->hasVerifiedEmail()) {
return redirect()->intended(AppServiceProvider::HOME.'?verified=1');
}
if ($user->markEmailAsVerified()) {
event(new Verified($user));
}
return redirect()->intended(AppServiceProvider::HOME.'?verified=1');
}
private function handle(MustVerifyEmail $user): RedirectResponse
{
if ($user->hasVerifiedEmail()) {
return redirect()->intended(AppServiceProvider::HOME);
}
$user->sendEmailVerificationNotification();
return back()->withSuccess(
__(
'Link verifikasi sudah dikirim ke alamat email :email',
[
'email' => $user->getEmailForVerification(),
]
)
);
}
}
<?php
namespace App\Http\Controllers;
abstract class Controller
{
//
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
public function __invoke(Request $request)
{
return view('dashboard');
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
class Home extends Controller
{
public function __invoke(Request $request): View
{
return view('home');
}
}
<?php
namespace App\Http\Controllers\My;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Controller;
use Laravolt\Epicentrum\Http\Requests\My\Password\Update;
class PasswordController extends Controller
{
public function edit(): View
{
$user = auth()->user();
return view('my.password.edit', compact('user'));
}
public function update(Update $request): RedirectResponse
{
/** @var string $password */
$password = $request->input('password_current');
/** @var \App\Models\User $user */
$user = auth()->user();
if (app('hash')->check($password, $user->password)) {
$user->setPassword($request->password);
return redirect()->route('my::password.edit')->withSuccess(__('laravolt::message.password_updated'));
}
return redirect()->route('my::password.edit')->withError(
__('laravolt::message.current_password_mismatch')
);
}
}
<?php
namespace App\Http\Controllers\My;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Controller;
use Laravolt\Epicentrum\Http\Requests\My\Profile\Update;
use Laravolt\Support\Contracts\TimezoneRepository;
class ProfileController extends Controller
{
public function edit(TimezoneRepository $timezone): View
{
$user = auth()->user();
$timezones = $timezone->all();
return view('my.profile.edit', compact('user', 'timezones'));
}
public function update(Update $request): RedirectResponse
{
/** @var \App\Models\User $user */
$user = auth()->user();
/** @var array<string, mixed> $validated */
$validated = $request->validated();
$user->update($validated);
return redirect()->back()->withSuccess(__('Profil berhasil diperbarui'));
}
}
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*/
protected function redirectTo(Request $request): ?string
{
return $request->expectsJson() ? null : route('auth::login.show');
}
}
<?php
namespace App\Http\Middleware;
use App\Providers\AppServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(AppServiceProvider::HOME);
}
}
return $next($request);
}
}
<?php
namespace App\Http\Requests\Auth;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
class LoginRequest extends FormRequest
{
protected int $maxAttempts = 5;
protected int $decaySeconds = 60;
/**
* Get the validation rules that apply to the request.
*
* @return array<string, string|array<mixed>>
*/
public function rules(): array
{
return [
'email' => 'required|string|email',
'password' => 'required|string',
];
}
/**
* Attempt to authenticate the request's credentials.
*
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
public function authenticate()
{
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password') + ['status' => 'ACTIVE'], $this->filled('remember'))) {
RateLimiter::hit($this->throttleKey(), $this->decaySeconds);
throw ValidationException::withMessages(
[
'email' => __('auth.failed'),
]
);
}
RateLimiter::clear($this->throttleKey());
}
/**
* Ensure the login request is not rate limited.
*
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
public function ensureIsNotRateLimited()
{
if (! RateLimiter::tooManyAttempts($this->throttleKey(), $this->maxAttempts)) {
return;
}
event(new Lockout($this));
$seconds = RateLimiter::availableIn($this->throttleKey());
throw ValidationException::withMessages(
[
'email' => trans(
'auth.throttle',
[
'seconds' => $seconds,
'minutes' => ceil($seconds / 60),
]
),
]
);
}
/**
* Get the rate limiting throttle key for the request.
*/
public function throttleKey(): string
{
/** @var string $email */
$email = $this->input('email');
return Str::lower($email).'|'.$this->ip();
}
}
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Notifications\Notifiable;
use Laravolt\Platform\Models\User as BaseUser;
use Laravolt\Suitable\AutoFilter;
use Laravolt\Suitable\AutoSearch;
use Laravolt\Suitable\AutoSort;
/**
* @use HasFactory<UserFactory>
*/
class User extends BaseUser
{
use AutoFilter, AutoSearch, AutoSort;
/** @use HasFactory<UserFactory> */
use HasFactory, Notifiable;
// use \Laravel\Sanctum\HasApiTokens;
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['name', 'email', 'username', 'password', 'status', 'timezone'];
/**
* The attributes that should be hidden for serialization.
*/
protected $hidden = ['password', 'remember_token'];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* The path to the "home" route for your application.
*
* Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/home';
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
$this->registerPolicies();
}
}
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Laravolt\Listeners\SendEmailVerificationNotification;
class EventServiceProvider extends ServiceProvider
{
/**
* The event handler mappings for the application.
*
* @var array<string, array<int, string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Boot any application services.
*/
public function boot(): void
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*/
public function shouldDiscoverEvents(): bool
{
return false;
}
}
#!/usr/bin/env php
<?php
use Illuminate\Foundation\Application;
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...
/** @var Application $app */
$app = require_once __DIR__.'/bootstrap/app.php';
$status = $app->handleCommand(new ArgvInput);
exit($status);
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Request;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
$middleware->appendToGroup('web', [
\Laravolt\Middleware\DetectFlashMessage::class,
\Laravolt\Middleware\CheckPassword::class,
]);
$middleware->alias([
'auth' => \App\Http\Middleware\Authenticate::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
]);
})
->withExceptions(function (Exceptions $exceptions) {
$exceptions->dontReportDuplicates();
$exceptions->reportable(function (\Throwable $e) {
if (app()->bound('sentry')) {
app('sentry')->captureException($e);
}
});
$exceptions->render(function (\Illuminate\Session\TokenMismatchException $e) {
return back()->with(
'error',
__('Kami mendeteksi tidak ada aktivitas cukup lama, silakan kirim ulang form.')
);
});
$exceptions->render(function (\Illuminate\Auth\AuthenticationException $e, Request $request) {
if ($request->expectsJson()) {
return response()->json(['message' => $e->getMessage()], 401);
}
return redirect()
->guest($e->redirectTo($request) ?? route('auth::login.show'))
->with('warning', __('Silakan login terlebih dahulu') ?? '');
});
$exceptions->render(function (\Illuminate\Auth\Access\AuthorizationException $e, Request $request) {
if ($request->wantsJson()) {
return response()->json(['message' => $e->getMessage()], 403);
}
if ($request->is('livewire/*')) {
return abort(403);
}
return redirect()
->back(302, [], route('home'))
->withInput()
->with('error', $e->getMessage());
});
})->create();
<?php
return [
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
];
{
"$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": "^12.0",
"laravel/tinker": "^2.10.1",
"laravolt/laravolt": "^6.14"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.13",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"phpunit/phpunit": "^11.5.3"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"@php artisan config:clear",
"@php artisan clear-compiled",
"@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"
],
"test": [
"@php artisan config:clear --ansi",
"@php artisan test"
]
},
"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
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?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' => '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(',', (string) 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'),
],
];
<?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 number 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),
];
<?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((string) env('APP_NAME', 'laravel')).'-cache-'),
];
<?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((string) env('APP_NAME', 'laravel')).'-database-'),
'persistent' => env('REDIS_PERSISTENT', false),
],
'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'),
],
],
];
<?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'),
],
];
<?php
return [
// Configuration for the default group. Feel free to add more groups.
// Each group can have different settings.
'default' => [
/**
* Regex to match against a filename/url to determine if it is an asset.
*
* @var string
*/
'asset_regex' => '/.\.(css|js)$/i',
/**
* Absolute path to the public directory of your App (WEBROOT).
* Required if you enable the pipeline.
* No trailing slash!.
*
* @var string
*/
'public_dir' => public_path(),
/**
* Directory for local CSS assets.
* Relative to your public directory ('public_dir').
* No trailing slash!.
*
* @var string
*/
'css_dir' => 'css',
/**
* Directory for local JavaScript assets.
* Relative to your public directory ('public_dir').
* No trailing slash!.
*
* @var string
*/
'js_dir' => 'js',
/**
* Available collections.
* Each collection is an array of assets.
* Collections may also contain other collections.
*
* @var array
*/
'collections' => [
// jQuery (CDN)
// 'jquery-cdn' => array('//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'),
// jQuery UI (CDN)
// 'jquery-ui-cdn' => array(
// 'jquery-cdn',
// '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js',
// ),
// Twitter Bootstrap (CDN)
// 'bootstrap-cdn' => array(
// 'jquery-cdn',
// '//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css',
// '//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css',
// '//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js'
// ),
// Redactor
'redactor' => [
'/laravolt/css/redactor.min.css',
'/laravolt/js/redactor.min.js',
],
],
/**
* Preload assets.
* Here you may set which assets (CSS files, JavaScript files or collections)
* should be loaded by default even if you don't explicitly add them on run time.
*
* @var array
*/
'autoload' => [
// 'jquery-cdn',
],
], // End of default group
];
<?php
return [
'routes' => [
'enabled' => true,
'middleware' => ['web', 'auth'],
'prefix' => 'resource',
],
'menu' => [
'enabled' => true,
'label' => 'Resources',
],
'permission' => \Laravolt\Platform\Enums\Permission::MANAGE_SYSTEM,
];
<?php
/*
* Set specific configuration variables here
*/
return [
'routes' => [
'enabled' => true,
'middleware' => config('laravolt.platform.middleware'),
'prefix' => 'database-monitor',
],
'view' => [
'layout' => 'laravolt::layouts.app',
],
'menu' => [
'enabled' => true,
],
'disk' => env('DB_BACKUP_DISK', 'local'),
];
<?php
/*
* Set specific configuration variables here
*/
return [
'role' => [
'multiple' => true,
'editable' => true,
],
'repository' => [
'user' => \Laravolt\Epicentrum\Repositories\EloquentRepository::class,
'role' => \Laravolt\Epicentrum\Repositories\RoleRepository::class,
'timezone' => \Laravolt\Support\Repositories\TimezoneRepository::class,
'searchable' => ['name', 'email', 'status'],
],
'requests' => [
'account' => [
'store' => \Laravolt\Epicentrum\Http\Requests\Account\Store::class,
'update' => \Laravolt\Epicentrum\Http\Requests\Account\Update::class,
'delete' => \Laravolt\Epicentrum\Http\Requests\Account\Delete::class,
],
],
// Max user allowed
// null or 0 mean unlimited
'user_limit' => null,
'user_available_status' => [
'PENDING' => 'PENDING',
'ACTIVE' => 'ACTIVE',
'BLOCKED' => 'BLOCKED',
],
'models' => [
'user' => \App\Models\User::class,
'role' => \Laravolt\Platform\Models\Role::class,
'permission' => \Laravolt\Platform\Models\Permission::class,
],
'table_view' => \Laravolt\Epicentrum\Livewire\UserTable::class,
];
<?php
return [
'routes' => [
'enabled' => true,
'middleware' => config('laravolt.platform.middleware'),
'prefix' => '',
],
'view' => [
'layout' => 'laravolt::layouts.app',
],
'menu' => [
'enabled' => true,
],
'permission' => \Laravolt\Platform\Enums\Permission::MANAGE_LOOKUP,
'collections' => [
// Sample lookup collections
'pekerjaan' => [
'label' => 'Pekerjaan',
],
],
];
<?php
return [
'System' => [
'order' => 99,
'menu' => [
'Users' => [
'route' => 'epicentrum::users.index',
'active' => 'epicentrum/users/*',
'icon' => 'user-friends',
'permissions' => [\Laravolt\Platform\Enums\Permission::MANAGE_USER],
],
'Roles' => [
'route' => 'epicentrum::roles.index',
'config' => 'epicentrum/roles/*',
'icon' => 'user-astronaut',
'permissions' => [\Laravolt\Platform\Enums\Permission::MANAGE_ROLE],
],
'Permissions' => [
'route' => 'epicentrum::permissions.edit',
'active' => 'epicentrum/permissions/*',
'icon' => 'shield-check',
'permissions' => [\Laravolt\Platform\Enums\Permission::MANAGE_PERMISSION],
],
'Settings' => [
'route' => 'platform::settings.edit',
'active' => 'platform/settings/*',
'icon' => 'sliders-v',
'permissions' => [\Laravolt\Platform\Enums\Permission::MANAGE_SETTINGS],
],
],
],
'Application' => [
'order' => 1,
'menu' => [
'Dashboard' => [
'route' => 'dashboard',
'icon' => 'home',
],
],
],
];
<?php
/*
* Set specific configuration variables here
*/
return [
// ask user to change their password periodically
// leave null to skip checking or fill with integer (in days)
'duration' => null,
// where to redirect user to change their current password, if CheckPassword middleware applied
'redirect' => 'my/password',
// don't apply CheckPassword middleware to following url pattern
'except' => [
'auth/logout',
'_debugbar/*',
],
];
<?php
return [
'middleware' => ['web', 'auth'],
'features' => [
'database-monitor' => false,
'epicentrum' => true,
'mailkeeper' => false,
'lookup' => false,
'kitchen_sink' => false,
'spa' => false,
'quick_switcher' => false,
'registration' => true,
'verification' => true,
'captcha' => false,
'workflow' => false,
'enable_default_menu' => true,
],
'settings' => [
[
'type' => 'html',
'content' => '<h3 class="ui horizontal divider section m-t-3">Informasi Umum</h3>',
],
[
'type' => 'text',
'name' => 'brand_name',
'label' => 'Name',
],
[
'type' => 'text',
'name' => 'brand_description',
'label' => 'Description',
],
[
'type' => 'uploader',
'name' => 'brand_image',
'label' => 'Logo',
],
[
'type' => 'html',
'content' => '<h3 class="ui horizontal divider hidden m-t-3">Tampilan Sidebar</h3>',
],
[
'type' => 'dropdown',
'name' => 'font_size',
'label' => 'Ukuran Font',
'options' => ['sm' => 'Kecil', 'md' => 'Sedang', 'lg' => 'Besar'],
'inline' => true,
],
[
'type' => 'dropdown',
'name' => 'sidebar_density',
'label' => 'Density',
'options' => ['compact' => 'Compact', 'default' => 'Default'],
'rules' => ['required'],
],
[
'type' => \Laravolt\Fields\Field::RADIO_GROUP,
'name' => 'theme',
'options' => ['dark' => 'Dark', 'light' => 'Light', 'cool' => 'Cool'],
'label' => 'Tema',
'inline' => true,
],
[
'type' => \Laravolt\Fields\Field::DROPDOWN_COLOR,
'name' => 'color',
'label' => 'Warna Aksen',
'inline' => true,
],
[
'type' => 'html',
'content' => '<h3 class="ui horizontal divider section m-t-3">Halaman Login</h3>',
],
[
'type' => 'dropdown',
'options' => ['fullscreen' => 'Fullscreen', 'modern' => 'Modern', 'classic' => 'Classic'],
'name' => 'login_layout',
'label' => 'Layout',
'inline' => true,
],
],
];
<?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(',', (string) 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,
'handler_with' => [
'stream' => 'php://stderr',
],
'formatter' => env('LOG_STDERR_FORMATTER'),
'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'),
],
],
];
<?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((string) 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',
],
'retry_after' => 60,
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
'retry_after' => 60,
],
],
/*
|--------------------------------------------------------------------------
| 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'),
],
];
<?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',
],
];
<?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'),
],
'resend' => [
'key' => env('RESEND_KEY'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],
];
<?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", "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: "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),
];
<?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,
]);
}
}
<?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->ulid('id')->primary();
$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->ulid('id')->primary();
$table->foreignUlid('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->foreignUlid('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};
<?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');
}
};
<?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');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users_activation', function (Blueprint $table) {
$table->integer('user_id')->index();
$table->string('token')->index();
$table->timestamp('created_at');
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users_activation');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('acl_roles', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('name')->unique();
$table->string('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('acl_roles');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('acl_permissions', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('name')->unique();
$table->string('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('acl_permissions');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('acl_permission_role', function (Blueprint $table) {
$table->ulid('permission_id');
$table->ulid('role_id');
$table->foreign('permission_id')->references('id')->on('acl_permissions')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('acl_roles')->onDelete('cascade');
$table->primary(['permission_id', 'role_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('acl_permission_role');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('acl_role_user', function (Blueprint $table) {
$table->ulid('role_id');
$table->ulid('user_id');
$table->foreign('role_id')->references('id')->on('acl_roles')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->primary(['role_id', 'user_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('acl_role_user');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
protected $table;
/**
* AddStatusToUsers constructor.
*/
public function __construct()
{
$this->table = app(config('laravolt.epicentrum.models.user'))->getTable();
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table($this->table, function (Blueprint $table) {
if (! Schema::hasColumn($this->table, 'status')) {
$table->string('status')->after('email')->index()->nullable();
}
if (! Schema::hasColumn($this->table, 'timezone')) {
$table->string('timezone')->default(config('app.timezone'))->after('status');
}
if (! Schema::hasColumn($this->table, 'password_changed_at')) {
$table->timestamp('password_changed_at')->nullable()->after('password');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table($this->table, function (Blueprint $table) {
$table->dropColumn(['status', 'timezone', 'password_changed_at']);
});
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSettingsTable extends Migration
{
/**
* Set up the options.
*/
public function __construct()
{
$this->table = config('setting.database.table');
$this->key = config('setting.database.key');
$this->value = config('setting.database.value');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create($this->table, function (Blueprint $table) {
$table->increments('id');
$table->string($this->key)->index();
$table->text($this->value);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop($this->table);
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('media', function (Blueprint $table) {
$table->id();
$table->ulidMorphs('model');
$table->uuid()->nullable()->unique();
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('mime_type')->nullable();
$table->string('disk');
$table->string('conversions_disk')->nullable();
$table->unsignedBigInteger('size');
$table->json('manipulations');
$table->json('custom_properties');
$table->json('generated_conversions');
$table->json('responsive_images');
$table->unsignedInteger('order_column')->nullable()->index();
$table->nullableTimestamps();
});
}
};
<?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('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('sessions');
}
};
<?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',
]);
}
}
{
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
},
"devDependencies": {
"@tailwindcss/vite": "^4.0.0",
"axios": "^1.11.0",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^2.0.0",
"tailwindcss": "^4.0.0",
"vite": "^7.0.4"
}
}
includes:
- ./vendor/larastan/larastan/extension.neon
- ./vendor/spaze/phpstan-disallowed-calls/extension.neon
parameters:
paths:
- app
# Level 8 for development - maintaining high standards throughout development
# Better to catch issues early than in production
level: 8
# Strict settings for quality code
treatPhpDocTypesAsCertain: true
reportMaybes: true
reportStaticMethodSignatures: true
# Only allow very specific exceptions for Laravel's dynamic nature
# ignoreErrors:
# - '#Call to an undefined method.*Builder#' # Only if using complex query builders
disallowedFunctionCalls:
-
function: 'env()'
message: 'Use config() instead - see: https://laravel.com/docs/configuration#retrieving-configuration-values'
-
function: 'dd()'
message: 'Remove debug statements - use proper logging instead'
-
function: 'dump()'
message: 'Remove debug statements - use proper logging instead'
-
function: 'var_dump()'
message: 'Remove debug statements - use proper logging or testing assertions'
-
function: 'print_r()'
message: 'Use proper logging instead: Log::info() or logger()'
-
function: 'exit()'
message: 'Avoid exit() - use proper exception handling and HTTP responses'
-
function: 'die()'
message: 'Avoid die() - use proper exception handling and HTTP responses'
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Modules">
<directory>modules/*/Tests</directory>
</testsuite>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
<directory>modules</directory>
</include>
<exclude>
<directory suffix=".blade.php">modules/*/resources</directory>
<directory suffix="Factory.php">modules/*/Models</directory>
<directory suffix="Test.php">modules/*/Tests</directory>
<directory>modules/*/routes</directory>
</exclude>
</source>
<coverage>
<report>
<html outputDirectory="build/coverage" />
<clover outputFile="phpunit-coverage-result.xml" />
</report>
</coverage>
<logging>
<junit outputFile="phpunit-execution-result.xml" />
</logging>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_STORE" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_MAILER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Handle X-XSRF-Token Header
RewriteCond %{HTTP:x-xsrf-token} .
RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
<?php
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';
// Bootstrap Laravel and handle the request...
/** @var Application $app */
$app = require_once __DIR__.'/../bootstrap/app.php';
$app->handleRequest(Request::capture());
User-agent: *
Disallow:
@import 'tailwindcss';
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';
@theme {
--font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
}
import './bootstrap';
import axios from 'axios';
window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
<?php
return [
/*
|--------------------------------------------------------------------------
| Baris-baris bahasa untuk autentifikasi
|--------------------------------------------------------------------------
|
| Baris bahasa berikut digunakan selama proses autentifikasi untuk beberapa
| pesan yang perlu kita tampilkan ke pengguna. Anda bebas untuk memodifikasi
| baris bahasa sesuai dengan keperluan aplikasi anda.
|
*/
'failed' => 'Identitas tersebut tidak cocok dengan data kami.',
'throttle' => 'Terlalu banyak usaha masuk. Silahkan coba lagi dalam :seconds detik.',
];
<?php
return [
/*
|---------------------------------------------------------------------------------------
| Baris Bahasa untuk Penomoran Halaman
|---------------------------------------------------------------------------------------
|
| Baris bahasa berikut meggunakan pustaka penomoran untuk membuat
| tautan yang sederhana. Anda bebas untuk mengubahnya kapan pun yang Anda
| inginkan menyesuaikan dengan pandangan Anda agar lebih cocok ke aplikasi Anda.
|
*/
'previous' => '&laquo; Sebelumnya',
'next' => 'Berikutnya &raquo;',
];
<?php
return [
/*
|---------------------------------------------------------------------------------------
| Baris Bahasa untuk Pengingat Kata Sandi
|---------------------------------------------------------------------------------------
|
| Baris bahasa berikut adalah baris standar yang cocok dengan alasan yang
| diberikan oleh pembongkar kata sandi yang telah gagal dalam upaya pembaruan
| kata sandi, misalnya token tidak valid atau kata sandi baru tidak valid.
|
*/
'password' => 'Kata sandi minimal harus memiliki enam karakter dan cocok dengan konfirmasi.',
'reset' => 'Kata sandi Anda sudah direset!',
'sent' => 'Kami sudah mengirim surel yang berisi tautan untuk mereset kata sandi Anda!',
'token' => 'Token pengaturan ulang kata sandi tidak sah.',
'user' => 'Kami tidak dapat menemukan pengguna dengan alamat surel tersebut.',
];
<?php
return [
/*
|---------------------------------------------------------------------------------------
| Baris Bahasa untuk Validasi
|---------------------------------------------------------------------------------------
|
| Baris bahasa berikut ini berisi standar pesan kesalahan yang digunakan oleh
| kelas validasi. Beberapa aturan mempunyai banyak versi seperti aturan 'size'.
| Jangan ragu untuk mengoptimalkan setiap pesan yang ada di sini.
|
*/
'accepted' => ':attribute harus diterima.',
'active_url' => ':attribute bukan URL yang valid.',
'after' => ':attribute harus berisi tanggal setelah :date.',
'after_or_equal' => ':attribute harus berisi tanggal setelah atau sama dengan :date.',
'alpha' => ':attribute hanya boleh berisi huruf.',
'alpha_dash' => ':attribute hanya boleh berisi huruf, angka, strip, dan garis bawah.',
'alpha_num' => ':attribute hanya boleh berisi huruf dan angka.',
'array' => ':attribute harus berisi sebuah array.',
'before' => ':attribute harus berisi tanggal sebelum :date.',
'before_or_equal' => ':attribute harus berisi tanggal sebelum atau sama dengan :date.',
'between' => [
'numeric' => ':attribute harus bernilai antara :min sampai :max.',
'file' => ':attribute harus berukuran antara :min sampai :max kilobita.',
'string' => ':attribute harus berisi antara :min sampai :max karakter.',
'array' => ':attribute harus memiliki :min sampai :max anggota.',
],
'boolean' => ':attribute harus bernilai true atau false',
'confirmed' => 'Konfirmasi :attribute tidak cocok.',
'date' => ':attribute bukan tanggal yang valid.',
'date_equals' => ':attribute harus berisi tanggal yang sama dengan :date.',
'date_format' => ':attribute tidak cocok dengan format :format.',
'different' => ':attribute dan :other harus berbeda.',
'digits' => ':attribute harus terdiri dari :digits angka.',
'digits_between' => ':attribute harus terdiri dari :min sampai :max angka.',
'dimensions' => ':attribute tidak memiliki dimensi gambar yang valid.',
'distinct' => ':attribute memiliki nilai yang duplikat.',
'email' => ':attribute harus berupa alamat surel yang valid.',
'ends_with' => ':attribute harus diakhiri salah satu dari berikut: :values',
'exists' => ':attribute yang dipilih tidak valid.',
'file' => ':attribute harus berupa sebuah berkas.',
'filled' => ':attribute harus memiliki nilai.',
'gt' => [
'numeric' => ':attribute harus bernilai lebih besar dari :value.',
'file' => ':attribute harus berukuran lebih besar dari :value kilobita.',
'string' => ':attribute harus berisi lebih besar dari :value karakter.',
'array' => ':attribute harus memiliki lebih dari :value anggota.',
],
'gte' => [
'numeric' => ':attribute harus bernilai lebih besar dari atau sama dengan :value.',
'file' => ':attribute harus berukuran lebih besar dari atau sama dengan :value kilobita.',
'string' => ':attribute harus berisi lebih besar dari atau sama dengan :value karakter.',
'array' => ':attribute harus terdiri dari :value anggota atau lebih.',
],
'image' => ':attribute harus berupa gambar.',
'in' => ':attribute yang dipilih tidak valid.',
'in_array' => ':attribute tidak ada di dalam :other.',
'integer' => ':attribute harus berupa bilangan bulat.',
'ip' => ':attribute harus berupa alamat IP yang valid.',
'ipv4' => ':attribute harus berupa alamat IPv4 yang valid.',
'ipv6' => ':attribute harus berupa alamat IPv6 yang valid.',
'json' => ':attribute harus berupa JSON string yang valid.',
'lookup' => ':attribute harus berupa lookup yang valid.',
'lt' => [
'numeric' => ':attribute harus bernilai kurang dari :value.',
'file' => ':attribute harus berukuran kurang dari :value kilobita.',
'string' => ':attribute harus berisi kurang dari :value karakter.',
'array' => ':attribute harus memiliki kurang dari :value anggota.',
],
'lte' => [
'numeric' => ':attribute harus bernilai kurang dari atau sama dengan :value.',
'file' => ':attribute harus berukuran kurang dari atau sama dengan :value kilobita.',
'string' => ':attribute harus berisi kurang dari atau sama dengan :value karakter.',
'array' => ':attribute harus tidak lebih dari :value anggota.',
],
'max' => [
'numeric' => ':attribute maskimal bernilai :max.',
'file' => ':attribute maksimal berukuran :max kilobita.',
'string' => ':attribute maskimal berisi :max karakter.',
'array' => ':attribute maksimal terdiri dari :max anggota.',
],
'mimes' => ':attribute harus berupa berkas berjenis: :values.',
'mimetypes' => ':attribute harus berupa berkas berjenis: :values.',
'min' => [
'numeric' => ':attribute minimal bernilai :min.',
'file' => ':attribute minimal berukuran :min kilobita.',
'string' => ':attribute minimal berisi :min karakter.',
'array' => ':attribute minimal terdiri dari :min anggota.',
],
'not_in' => ':attribute yang dipilih tidak valid.',
'not_regex' => 'Format :attribute tidak valid.',
'numeric' => ':attribute harus berupa angka.',
'password' => 'Kata sandi salah.',
'present' => ':attribute wajib ada.',
'regex' => 'Format :attribute tidak valid.',
'required' => ':attribute wajib diisi.',
'required_if' => ':attribute wajib diisi bila :other adalah :value.',
'required_unless' => ':attribute wajib diisi kecuali :other memiliki nilai :values.',
'required_with' => ':attribute wajib diisi bila terdapat :values.',
'required_with_all' => ':attribute wajib diisi bila terdapat :values.',
'required_without' => ':attribute wajib diisi bila tidak terdapat :values.',
'required_without_all' => ':attribute wajib diisi bila sama sekali tidak terdapat :values.',
'same' => ':attribute dan :other harus sama.',
'size' => [
'numeric' => ':attribute harus berukuran :size.',
'file' => ':attribute harus berukuran :size kilobyte.',
'string' => ':attribute harus berukuran :size karakter.',
'array' => ':attribute harus mengandung :size anggota.',
],
'starts_with' => ':attribute harus diawali salah satu dari berikut: :values',
'string' => ':attribute harus berupa string.',
'timezone' => ':attribute harus berisi zona waktu yang valid.',
'unique' => ':attribute sudah ada sebelumnya.',
'uploaded' => ':attribute gagal diunggah.',
'url' => 'Format :attribute tidak valid.',
'uuid' => ':attribute harus merupakan UUID yang valid.',
/*
|---------------------------------------------------------------------------------------
| Baris Bahasa untuk Validasi Kustom
|---------------------------------------------------------------------------------------
|
| Di sini Anda dapat menentukan pesan validasi untuk atribut sesuai keinginan dengan
| menggunakan konvensi "attribute.rule" dalam penamaan barisnya. Hal ini mempercepat
| dalam menentukan baris bahasa kustom yang spesifik untuk aturan atribut yang diberikan.
|
*/
'custom' => [
'attribute-name' => [
'rule-name' => 'custom-message',
],
],
/*
|---------------------------------------------------------------------------------------
| Kustom Validasi Atribut
|---------------------------------------------------------------------------------------
|
| Baris bahasa berikut digunakan untuk menukar 'placeholder' atribut dengan sesuatu
| yang lebih mudah dimengerti oleh pembaca seperti "Alamat Surel" daripada "surel" saja.
| Hal ini membantu kita dalam membuat pesan menjadi lebih ekspresif.
|
*/
'attributes' => [
],
];
<x-volt-auth>
<h3 class="ui header horizontal divider section">@lang('laravolt::auth.forgot_password')</h3>
{!! form()->open(route('auth::forgot.store')) !!}
{!! form()->email('email')->label(__('laravolt::auth.email')) !!}
<div class="field action">
<x-volt-button class="fluid">@lang('laravolt::auth.send_reset_password_link')</x-volt-button>
</div>
@if(config('laravolt.platform.features.registration'))
<div class="ui divider section"></div>
@lang('laravolt::auth.not_registered_yet?')
<a themed href="{{ route('auth::registration.show') }}" class="link">@lang('laravolt::auth.register_here')</a>
@endif
{!! form()->close() !!}
</x-volt-auth>>
<x-volt-auth>
<h3 class="ui header horizontal divider section">@lang('laravolt::auth.login')</h3>
{!! form()->open(route('auth::login.store'))->attribute('up-target', 'body') !!}
{!! form()->email('email')->label(__('laravolt::auth.identifier')) !!}
{!! form()->password('password')->label(__('laravolt::auth.password')) !!}
@if(config('laravolt.platform.features.captcha'))
<div class="field">
{!! app('captcha')->display() !!}
{!! app('captcha')->renderJs() !!}
</div>
@endif
<div class="ui field m-b-2">
<div class="ui equal width grid">
<div class="column left aligned">
<div class="ui checkbox">
<input type="checkbox" name="remember" {{ request()->old('remember')?'checked':'' }}>
<label>@lang('laravolt::auth.remember')</label>
</div>
</div>
<div class="column right aligned">
<a themed href="{{ route('auth::forgot.show') }}"
class="link">@lang('laravolt::auth.forgot_password')</a>
</div>
</div>
</div>
<div class="field action">
<x-volt-button class="fluid">@lang('laravolt::auth.login')</x-volt-button>
</div>
@if(config('laravolt.platform.features.registration'))
<div class="ui divider section"></div>
<div>
@lang('laravolt::auth.not_registered_yet?')
<a themed href="{{ route('auth::registration.show') }}"
class="link">@lang('laravolt::auth.register_here')</a>
</div>
@endif
{!! form()->close() !!}
</x-volt-auth>
<x-volt-auth>
<h3 class="ui header horizontal divider section">@lang('laravolt::auth.register')</h3>
{!! form()->open(route('auth::registration.store')) !!}
{!! form()->text('name')->label(__('Name')) !!}
{!! form()->email('email')->label(__('Email')) !!}
{!! form()->password('password')->label(__('Password')) !!}
{!! form()->password('password_confirmation')->label(__('Confirm Your Password')) !!}
<div class="field action">
<x-volt-button class="fluid">@lang('laravolt::auth.register')</x-volt-button>
</div>
<div class="ui divider section"></div>
<div>
@lang('laravolt::auth.already_registered?')
<a themed href="{{ route('auth::login.show') }}" class="link">@lang('laravolt::auth.login_here')</a>
</div>
{!! form()->close() !!}
</x-volt-auth>>
<x-volt-auth>
<h3 class="ui header horizontal divider section">@lang('laravolt::auth.reset_password')</h3>
{!! form()->open(route('auth::reset.store', $token)) !!}
{!! form()->hidden('token', $token) !!}
{!! form()->email('email', request('email'))->label(__('Email'))->required() !!}
{!! form()->password('password')->label(__('New Password'))->required() !!}
{!! form()->password('password_confirmation')->label(__('Confirm New Password'))->required() !!}
{!! form()->action(form()->submit(__('Reset Password'))) !!}
{!! form()->close() !!}
<div class="ui divider section"></div>
@lang('laravolt::auth.already_registered?')
<a href="{{ route('auth::login.show') }}">@lang('laravolt::auth.login_here')</a>
</x-volt-auth>
<x-volt-auth>
<h3 class="ui header horizontal divider section">@lang('Verifikasi Email')</h3>
<div class="ui message p-3">
<strong>{{ __('Anda sudah terdaftar di aplikasi. ') }}</strong>
<p>{{ __('Sebelum bisa melanjutkan, silakan verifikasi akun Anda dengan mengklik link yang kami kirimkan ke alamat email :email.', ['email' => auth()->user()->getEmailForVerification()]) }}</p>
<p>@lang('Jika Anda belum menerima email, silakan klik tombol di bawah ini.')</p>
</div>
{!! form()->post(route('verification.send')) !!}
<x-volt-button class="fluid">@lang('Kirim Ulang Email Verifikasi')</x-volt-button>
{!! form()->close() !!}
<div class="ui divider section"></div>
<x-volt-link :url="route('auth::logout')" class="fluid">Logout</x-volt-link>
</x-volt-auth>
<x-volt-app title="Dashboard">
Hello world!
</x-volt-app>
<x-volt-app title="Home">
@extends('laravolt::layout')
@section('content')
<h1>🏠 Selamat Datang ke Training Base</h1>
<p>Anda login sebagai <b>{{ auth()->user()->name }}</b></p>
@endsection
</x-volt-app>
<x-volt-app :title="__('Edit Password')">
<x-volt-panel title="{{ __('Edit Password') }}" icon="user-lock">
{!! form()->open()->action(route('my::password.update'))->horizontal() !!}
{!! form()->password('password_current')->label(__('Current Password')) !!}
{!! form()->password('password')->label(__('New Password')) !!}
{!! form()->password('password_confirmation')->label(__('Confirm New Password')) !!}
{!! form()->action(form()->submit(__('Save'))) !!}
{!! form()->close() !!}
</x-volt-panel>
</x-volt-app>
<x-volt-app :title="__('Edit Profile')">
<x-volt-panel title="{{ __('Edit Profile') }}" icon="user-edit">
{!! form()->bind($user)->put(route('my::profile.update'))->horizontal() !!}
{!! form()->text('name')->label('Name') !!}
{!! form()->text('email')->label('Email')->readonly() !!}
{!! form()->dropdown('timezone', $timezones)->label('Timezone') !!}
{!! form()->action(form()->submit('Save')) !!}
{!! form()->close() !!}
</x-volt-panel>
</x-volt-app>
<?php
use App\Http\Controllers\Auth\ForgotPasswordController;
use App\Http\Controllers\Auth\LoginController;
use App\Http\Controllers\Auth\Logout;
use App\Http\Controllers\Auth\RegistrationController;
use App\Http\Controllers\Auth\ResetPasswordController;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
Route::group(
[
'prefix' => 'auth',
'middleware' => 'guest',
],
function (Router $router) {
$router->get('login', [LoginController::class, 'show'])->name('auth::login.show');
$router->post('login', [LoginController::class, 'store'])->name('auth::login.store');
$router->get('login-base', fn () => to_route('auth::login.show'))->name('login');
// Password Reset Routes...
$router->get('forgot', [ForgotPasswordController::class, 'show'])->name('auth::forgot.show');
$router->post('forgot', [ForgotPasswordController::class, 'store'])->name('auth::forgot.store');
$router->get('reset/{token}', [ResetPasswordController::class, 'show'])->name('auth::reset.show');
$router->post('reset/{token}', [ResetPasswordController::class, 'store'])->name('auth::reset.store');
if (config('laravolt.platform.features.registration')) {
$router->get('register', [RegistrationController::class, 'show'])->name('auth::registration.show');
$router->post('register', [RegistrationController::class, 'store'])->name('auth::registration.store');
}
}
);
Route::group(
[
'prefix' => 'auth',
'middleware' => 'auth',
],
function (Router $router) {
$router->any('logout', Logout::class)->name('auth::logout');
if (config('laravolt.platform.features.verification')) {
$router->get('/verify-email', [\App\Http\Controllers\Auth\VerificationController::class, 'show'])
->name('verification.notice');
$router->post('/verify-email', [\App\Http\Controllers\Auth\VerificationController::class, 'store'])
->middleware(['throttle:6,1'])
->name('verification.send');
$router->get('/verify-email/{id}/{hash}', [\App\Http\Controllers\Auth\VerificationController::class, 'update'])
->middleware(['signed', 'throttle:6,1'])
->name('verification.verify');
}
}
);
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
<?php
use Illuminate\Support\Facades\Route;
Route::middleware(['auth'])->group(function () {
// My Profile
Route::get('my/profile', [\App\Http\Controllers\My\ProfileController::class, 'edit'])->name('my::profile.edit');
Route::put('my/profile', [\App\Http\Controllers\My\ProfileController::class, 'update'])->name('my::profile.update');
// My Password
Route::get('my/password', [\App\Http\Controllers\My\PasswordController::class, 'edit'])->name('my::password.edit');
Route::post('my/password', [\App\Http\Controllers\My\PasswordController::class, 'update'])->name('my::password.update');
});
<?php
use App\Http\Controllers\Home;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::redirect('/', '/login');
Route::middleware(['auth', 'verified'])->group(fn () => Route::get('/home', Home::class)->name('home'));
Route::get('dashboard', \App\Http\Controllers\DashboardController::class)->name('dashboard');
include __DIR__.'/auth.php';
include __DIR__.'/my.php';
*
!private/
!public/
!.gitignore
compiled.php
config.php
down
events.scanned.php
maintenance.php
routes.php
routes.scanned.php
schedule-*
services.json
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment