Moved to _dev

This commit is contained in:
2025-09-20 16:11:47 +02:00
parent fb1a8753b7
commit b2ba11fcd3
1670 changed files with 224899 additions and 0 deletions

420
crater/config/abilities.php Normal file
View File

@@ -0,0 +1,420 @@
<?php
use Crater\Models\Customer;
use Crater\Models\CustomField;
use Crater\Models\Estimate;
use Crater\Models\ExchangeRateProvider;
use Crater\Models\Expense;
use Crater\Models\Invoice;
use Crater\Models\Item;
use Crater\Models\Note;
use Crater\Models\Payment;
use Crater\Models\RecurringInvoice;
use Crater\Models\TaxType;
return [
'abilities' => [
// Customer
[
"name" => "view customer",
"ability" => "view-customer",
"model" => Customer::class,
],
[
"name" => "create customer",
"ability" => "create-customer",
"model" => Customer::class,
"depends_on" => [
'view-customer',
'view-custom-field',
]
],
[
"name" => "edit customer",
"ability" => "edit-customer",
"model" => Customer::class,
"depends_on" => [
'view-customer',
'view-custom-field',
]
],
[
"name" => "delete customer",
"ability" => "delete-customer",
"model" => Customer::class,
"depends_on" => [
'view-customer',
]
],
// Item
[
"name" => "view item",
"ability" => "view-item",
"model" => Item::class,
],
[
"name" => "create item",
"ability" => "create-item",
"model" => Item::class,
"depends_on" => [
'view-item',
'view-tax-type'
]
],
[
"name" => "edit item",
"ability" => "edit-item",
"model" => Item::class,
"depends_on" => [
'view-item',
]
],
[
"name" => "delete item",
"ability" => "delete-item",
"model" => Item::class,
"depends_on" => [
'view-item',
]
],
// Tax Type
[
"name" => "view tax type",
"ability" => "view-tax-type",
"model" => TaxType::class,
],
[
"name" => "create tax type",
"ability" => "create-tax-type",
"model" => TaxType::class,
"depends_on" => [
'view-tax-type',
]
],
[
"name" => "edit tax type",
"ability" => "edit-tax-type",
"model" => TaxType::class,
"depends_on" => [
'view-tax-type',
]
],
[
"name" => "delete tax type",
"ability" => "delete-tax-type",
"model" => TaxType::class,
"depends_on" => [
'view-tax-type',
]
],
// Estimate
[
"name" => "view estimate",
"ability" => "view-estimate",
"model" => Estimate::class,
],
[
"name" => "create estimate",
"ability" => "create-estimate",
"model" => Estimate::class,
"depends_on" => [
'view-estimate',
'view-item',
'view-tax-type',
'view-customer',
'view-custom-field',
'view-all-notes'
]
],
[
"name" => "edit estimate",
"ability" => "edit-estimate",
"model" => Estimate::class,
"depends_on" => [
'view-item',
'view-estimate',
'view-tax-type',
'view-customer',
'view-custom-field',
'view-all-notes'
]
],
[
"name" => "delete estimate",
"ability" => "delete-estimate",
"model" => Estimate::class,
"depends_on" => [
'view-estimate',
]
],
[
"name" => "send estimate",
"ability" => "send-estimate",
"model" => Estimate::class,
],
// Invoice
[
"name" => "view invoice",
"ability" => "view-invoice",
"model" => Invoice::class,
],
[
"name" => "create invoice",
"ability" => "create-invoice",
"model" => Invoice::class,
'owner_only' => false,
"depends_on" => [
'view-item',
'view-invoice',
'view-tax-type',
'view-customer',
'view-custom-field',
'view-all-notes'
]
],
[
"name" => "edit invoice",
"ability" => "edit-invoice",
"model" => Invoice::class,
"depends_on" => [
'view-item',
'view-invoice',
'view-tax-type',
'view-customer',
'view-custom-field',
'view-all-notes'
]
],
[
"name" => "delete invoice",
"ability" => "delete-invoice",
"model" => Invoice::class,
"depends_on" => [
'view-invoice'
]
],
[
"name" => "send invoice",
"ability" => "send-invoice",
"model" => Invoice::class,
],
// Recurring Invoice
[
"name" => "view recurring invoice",
"ability" => "view-recurring-invoice",
"model" => RecurringInvoice::class,
],
[
"name" => "create recurring invoice",
"ability" => "create-recurring-invoice",
"model" => RecurringInvoice::class,
"depends_on" => [
'view-item',
'view-recurring-invoice',
'view-tax-type',
'view-customer',
'view-all-notes',
'send-invoice'
]
],
[
"name" => "edit recurring invoice",
"ability" => "edit-recurring-invoice",
"model" => RecurringInvoice::class,
"depends_on" => [
'view-item',
'view-recurring-invoice',
'view-tax-type',
'view-customer',
'view-all-notes',
'send-invoice'
]
],
[
"name" => "delete recurring invoice",
"ability" => "delete-recurring-invoice",
"model" => RecurringInvoice::class,
"depends_on" => [
'view-recurring-invoice',
]
],
// Payment
[
"name" => "view payment",
"ability" => "view-payment",
"model" => Payment::class,
],
[
"name" => "create payment",
"ability" => "create-payment",
"model" => Payment::class,
"depends_on" => [
'view-customer',
'view-payment',
'view-invoice',
'view-custom-field',
'view-all-notes'
]
],
[
"name" => "edit payment",
"ability" => "edit-payment",
"model" => Payment::class,
"depends_on" => [
'view-customer',
'view-payment',
'view-invoice',
'view-custom-field',
'view-all-notes'
]
],
[
"name" => "delete payment",
"ability" => "delete-payment",
"model" => Payment::class,
"depends_on" => [
'view-payment',
]
],
[
"name" => "send payment",
"ability" => "send-payment",
"model" => Payment::class,
],
// Expense
[
"name" => "view expense",
"ability" => "view-expense",
"model" => Expense::class,
],
[
"name" => "create expense",
"ability" => "create-expense",
"model" => Expense::class,
"depends_on" => [
'view-customer',
'view-expense',
'view-custom-field',
]
],
[
"name" => "edit expense",
"ability" => "edit-expense",
"model" => Expense::class,
"depends_on" => [
'view-customer',
'view-expense',
'view-custom-field',
]
],
[
"name" => "delete expense",
"ability" => "delete-expense",
"model" => Expense::class,
"depends_on" => [
'view-expense',
]
],
// Custom Field
[
"name" => "view custom field",
"ability" => "view-custom-field",
"model" => CustomField::class,
],
[
"name" => "create custom field",
"ability" => "create-custom-field",
"model" => CustomField::class,
"depends_on" => [
'view-custom-field',
]
],
[
"name" => "edit custom field",
"ability" => "edit-custom-field",
"model" => CustomField::class,
"depends_on" => [
'view-custom-field',
]
],
[
"name" => "delete custom field",
"ability" => "delete-custom-field",
"model" => CustomField::class,
"depends_on" => [
'view-custom-field',
]
],
// Financial Reports
[
"name" => "view financial reports",
"ability" => "view-financial-reports",
"model" => null,
],
// Exchange Rate Provider
[
"name" => "view exchange rate provider",
"ability" => "view-exchange-rate-provider",
"model" => ExchangeRateProvider::class,
'owner_only' => false,
],
[
"name" => "create exchange rate provider",
"ability" => "create-exchange-rate-provider",
"model" => ExchangeRateProvider::class,
'owner_only' => false,
"depends_on" => [
'view-exchange-rate-provider',
]
],
[
"name" => "edit exchange rate provider",
"ability" => "edit-exchange-rate-provider",
"model" => ExchangeRateProvider::class,
'owner_only' => false,
"depends_on" => [
'view-exchange-rate-provider',
]
],
[
"name" => "delete exchange rate provider",
"ability" => "delete-exchange-rate-provider",
"model" => ExchangeRateProvider::class,
'owner_only' => false,
"depends_on" => [
'view-exchange-rate-provider',
]
],
// Settings
[
"name" => "view company dashboard",
"ability" => "dashboard",
"model" => null,
],
[
"name" => "view all notes",
"ability" => "view-all-notes",
"model" => Note::class,
],
[
"name" => "manage notes",
"ability" => "manage-all-notes",
"model" => Note::class,
"depends_on" => [
'view-all-notes'
]
]
]
];

226
crater/config/app.php Normal file
View File

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

130
crater/config/auth.php Normal file
View File

@@ -0,0 +1,130 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
'customer' => [
'driver' => 'session',
'provider' => 'customers',
'hash' => false,
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \Crater\Models\User::class,
],
'customers' => [
'driver' => 'eloquent',
'model' => \Crater\Models\Customer::class,
],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
'customers' => [
'provider' => 'customers',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];

241
crater/config/backup.php Normal file
View File

@@ -0,0 +1,241 @@
<?php
return [
'backup' => [
/*
* The name of this application. You can use this name to monitor
* the backups.
*/
'name' => env('APP_NAME', 'laravel-backup'),
'source' => [
'files' => [
/*
* The list of directories and files that will be included in the backup.
*/
'include' => [
base_path(),
],
/*
* These directories and files will be excluded from the backup.
*
* Directories used by the backup process will automatically be excluded.
*/
'exclude' => [
base_path('vendor'),
base_path('node_modules'),
base_path('.git'),
],
/*
* Determines if symlinks should be followed.
*/
'follow_links' => false,
/*
* Determines if it should avoid unreadable folders.
*/
'ignore_unreadable_directories' => false,
],
/*
* The names of the connections to the databases that should be backed up
* MySQL, PostgreSQL, SQLite and Mongo databases are supported.
*
* The content of the database dump may be customized for each connection
* by adding a 'dump' key to the connection settings in config/database.php.
* E.g.
* 'mysql' => [
* ...
* 'dump' => [
* 'excludeTables' => [
* 'table_to_exclude_from_backup',
* 'another_table_to_exclude'
* ]
* ],
* ],
*
* If you are using only InnoDB tables on a MySQL server, you can
* also supply the useSingleTransaction option to avoid table locking.
*
* E.g.
* 'mysql' => [
* ...
* 'dump' => [
* 'useSingleTransaction' => true,
* ],
* ],
*
* For a complete list of available customization options, see https://github.com/spatie/db-dumper
*/
'databases' => [
'mysql',
],
],
/*
* The database dump can be compressed to decrease diskspace usage.
*
* Out of the box Laravel-backup supplies
* Spatie\DbDumper\Compressors\GzipCompressor::class.
*
* You can also create custom compressor. More info on that here:
* https://github.com/spatie/db-dumper#using-compression
*
* If you do not want any compressor at all, set it to null.
*/
'database_dump_compressor' => null,
'destination' => [
/*
* The filename prefix used for the backup zip file.
*/
'filename_prefix' => '',
/*
* The disk names on which the backups will be stored.
*/
'disks' => [
'local',
],
],
/*
* The directory where the temporary files will be stored.
*/
'temporary_directory' => storage_path('app/backup-temp'),
],
/*
* You can get notified when specific events occur. Out of the box you can use 'mail' and 'slack'.
* For Slack you need to install guzzlehttp/guzzle and laravel/slack-notification-channel.
*
* You can also use your own notification classes, just make sure the class is named after one of
* the `Spatie\Backup\Events` classes.
*/
'notifications' => [
'notifications' => [
\Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => [],
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => [],
\Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => [],
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => [],
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => [],
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => [],
],
/*
* Here you can specify the notifiable to which the notifications should be sent. The default
* notifiable will use the variables specified in this config file.
*/
'notifiable' => \Spatie\Backup\Notifications\Notifiable::class,
'mail' => [
'to' => 'your@example.com',
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
],
'slack' => [
'webhook_url' => '',
/*
* If this is set to null the default channel of the webhook will be used.
*/
'channel' => null,
'username' => null,
'icon' => null,
],
],
/*
* Here you can specify which backups should be monitored.
* If a backup does not meet the specified requirements the
* UnHealthyBackupWasFound event will be fired.
*/
'monitor_backups' => [
[
'name' => env('APP_NAME', 'laravel-backup'),
'disks' => ['local'],
'health_checks' => [
\Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1,
\Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000,
],
],
/*
[
'name' => 'name of the second app',
'disks' => ['local', 's3'],
'health_checks' => [
\Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1,
\Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000,
],
],
*/
],
'cleanup' => [
/*
* The strategy that will be used to cleanup old backups. The default strategy
* will keep all backups for a certain amount of days. After that period only
* a daily backup will be kept. After that period only weekly backups will
* be kept and so on.
*
* No matter how you configure it the default strategy will never
* delete the newest backup.
*/
'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class,
'default_strategy' => [
/*
* The number of days for which backups must be kept.
*/
'keep_all_backups_for_days' => 7,
/*
* The number of days for which daily backups must be kept.
*/
'keep_daily_backups_for_days' => 16,
/*
* The number of weeks for which one weekly backup must be kept.
*/
'keep_weekly_backups_for_weeks' => 8,
/*
* The number of months for which one monthly backup must be kept.
*/
'keep_monthly_backups_for_months' => 4,
/*
* The number of years for which one yearly backup must be kept.
*/
'keep_yearly_backups_for_years' => 2,
/*
* After cleaning up the backups remove the oldest backup until
* this amount of megabytes has been reached.
*/
'delete_oldest_backups_when_using_more_megabytes_than' => 5000,
],
],
'queue' => [
'name' => env('BACKUP_QUEUE_NAME', 'backup'),
],
];

View File

@@ -0,0 +1,59 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => 'ap2',
'encrypted' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

93
crater/config/cache.php Normal file
View File

@@ -0,0 +1,93 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file", "memcached", "redis"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| 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.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'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' => 'cache',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
];

35
crater/config/compile.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Additional Compiled Classes
|--------------------------------------------------------------------------
|
| Here you may specify additional classes to include in the compiled file
| generated by the `artisan optimize` command. These should be classes
| that are included on basically every request into the application.
|
*/
'files' => [
//
],
/*
|--------------------------------------------------------------------------
| Compiled File Providers
|--------------------------------------------------------------------------
|
| Here you may list service providers which define a "compiles" function
| that returns additional files that should be compiled, providing an
| easy way to get common files from any packages you are utilizing.
|
*/
'providers' => [
//
],
];

34
crater/config/cors.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];

507
crater/config/crater.php Normal file
View File

@@ -0,0 +1,507 @@
<?php
use Crater\Models\Customer;
use Crater\Models\CustomField;
use Crater\Models\Estimate;
use Crater\Models\ExchangeRateProvider;
use Crater\Models\Expense;
use Crater\Models\Invoice;
use Crater\Models\Item;
use Crater\Models\Note;
use Crater\Models\Payment;
use Crater\Models\RecurringInvoice;
use Crater\Models\TaxType;
return [
/*
* Minimum php version.
*/
'min_php_version' => '7.4.0',
/*
* Minimum mysql version.
*/
'min_mysql_version' => '5.7.7',
/*
* Minimum mariadb version.
*/
'min_mariadb_version' => '10.2.7',
/*
* Minimum pgsql version.
*/
'min_pgsql_version' => '9.2.0',
/*
* Minimum sqlite version.
*/
'min_sqlite_version' => '3.24.0',
/*
* Marketplace url.
*/
'base_url' => 'https://craterapp.com',
/*
* List of languages supported by Crater.
*/
'languages' => [
["code" => "ar", "name" => "Arabic"],
["code" => "nl", "name" => "Dutch"],
["code" => "en", "name" => "English"],
["code" => "fr", "name" => "French"],
["code" => "de", "name" => "German"],
["code" => "ja", "name" => "Japanese"],
["code" => "it", "name" => "Italian"],
["code" => "lv", "name" => "Latvian"],
["code" => "pl", "name" => "Polish"],
["code" => "pt_BR", "name" => "Portuguese (Brazilian)"],
["code" => "sr", "name" => "Serbian Latin"],
["code" => "ko", "name" => "Korean"],
["code" => "es", "name" => "Spanish"],
["code" => "sv", "name" => "Svenska"],
["code" => "sk", "name" => "Slovak"],
["code" => "vi", "name" => "Tiếng Việt"],
["code" => "cs", "name" => "Czech"],
["code" => "el", "name" => "Greek"],
["code" => "hr", "name" => "Crotian"],
["code" => "th", "name" => "ไทย"],
],
/*
* List of Fiscal Years
*/
'fiscal_years' => [
['key' => 'january-december' , 'value' => '1-12'],
['key' => 'february-january' , 'value' => '2-1'],
['key' => 'march-february' , 'value' => '3-2'],
['key' => 'april-march' , 'value' => '4-3'],
['key' => 'may-april' , 'value' => '5-4'],
['key' => 'june-may' , 'value' => '6-5'],
['key' => 'july-june' , 'value' => '7-6'],
['key' => 'august-july' , 'value' => '8-7'],
['key' => 'september-august' , 'value' => '9-8'],
['key' => 'october-september', 'value' => '10-9'],
['key' => 'november-october' , 'value' => '11-10'],
['key' => 'december-november', 'value' => '12-11'],
],
/*
* List of convert estimate options
*/
'convert_estimate_options' => [
['key' => 'settings.preferences.no_action', 'value' => 'no_action'],
['key' => 'settings.preferences.delete_estimate', 'value' => 'delete_estimate'],
['key' => 'settings.preferences.mark_estimate_as_accepted', 'value' => 'mark_estimate_as_accepted'],
],
/*
* List of retrospective edits
*/
'retrospective_edits' => [
['key' => 'settings.preferences.allow', 'value' => 'allow'],
['key' => 'settings.preferences.disable_on_invoice_partial_paid', 'value' => 'disable_on_invoice_partial_paid'],
['key' => 'settings.preferences.disable_on_invoice_paid', 'value' => 'disable_on_invoice_paid'],
['key' => 'settings.preferences.disable_on_invoice_sent', 'value' => 'disable_on_invoice_sent'],
],
/*
* List of setting menu
*/
'setting_menu' => [
[
'title' => 'settings.menu_title.account_settings',
'group' => '',
'name' => 'Account Settings',
'link' => '/admin/settings/account-settings',
'icon' => 'UserIcon',
'owner_only' => false,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.company_information',
'group' => '',
'name' => 'Company information',
'link' => '/admin/settings/company-info',
'icon' => 'OfficeBuildingIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.preferences',
'group' => '',
'name' => 'Preferences',
'link' => '/admin/settings/preferences',
'icon' => 'CogIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.customization',
'group' => '',
'name' => 'Customization',
'link' => '/admin/settings/customization',
'icon' => 'PencilAltIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.roles.title',
'group' => '',
'name' => 'Roles',
'link' => '/admin/settings/roles-settings',
'icon' => 'UserGroupIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.exchange_rate',
'group' => '',
'name' => 'Exchange Rate Provider',
'link' => '/admin/settings/exchange-rate-provider',
'icon' => 'CashIcon',
'owner_only' => false,
'ability' => 'view-exchange-rate-provider',
'model' => ExchangeRateProvider::class
],
[
'title' => 'settings.menu_title.notifications',
'group' => '',
'name' => 'Notifications',
'link' => '/admin/settings/notifications',
'icon' => 'BellIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.tax_types',
'group' => '',
'name' => 'Tax types',
'link' => '/admin/settings/tax-types',
'icon' => 'CheckCircleIcon',
'owner_only' => false,
'ability' => 'view-tax-type',
'model' => TaxType::class
],
[
'title' => 'settings.menu_title.payment_modes',
'group' => '',
'name' => 'Payment modes',
'link' => '/admin/settings/payment-mode',
'icon' => 'CreditCardIcon',
'owner_only' => false,
'ability' => 'view-payment',
'model' => Payment::class
],
[
'title' => 'settings.menu_title.custom_fields',
'group' => '',
'name' => 'Custom fields',
'link' => '/admin/settings/custom-fields',
'icon' => 'CubeIcon',
'owner_only' => false,
'ability' => 'view-custom-field',
'model' => CustomField::class
],
[
'title' => 'settings.menu_title.notes',
'group' => '',
'name' => 'Notes',
'link' => '/admin/settings/notes',
'icon' => 'ClipboardCheckIcon',
'owner_only' => false,
'ability' => 'view-all-notes',
'model' => Note::class
],
[
'title' => 'settings.menu_title.expense_category',
'group' => '',
'name' => 'Expense Category',
'link' => '/admin/settings/expense-category',
'icon' => 'ClipboardListIcon',
'owner_only' => false,
'ability' => 'view-expense',
'model' => Expense::class
],
[
'title' => 'settings.mail.mail_config',
'group' => '',
'name' => 'Mail Configuration',
'link' => '/admin/settings/mail-configuration',
'icon' => 'MailIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.file_disk',
'group' => '',
'name' => 'File Disk',
'link' => '/admin/settings/file-disk',
'icon' => 'FolderIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.backup',
'group' => '',
'name' => 'Backup',
'link' => '/admin/settings/backup',
'icon' => 'DatabaseIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'settings.menu_title.update_app',
'group' => '',
'name' => 'Update App',
'link' => '/admin/settings/update-app',
'icon' => 'RefreshIcon',
'owner_only' => true,
'ability' => '',
'model' => ''
],
],
/*
* List of main menu
*/
'main_menu' => [
[
'title' => 'navigation.dashboard',
'group' => 1,
'link' => '/admin/dashboard',
'icon' => 'HomeIcon',
'name' => 'Dashboard',
'owner_only' => false,
'ability' => 'dashboard',
'model' => ''
],
[
'title' => 'navigation.customers',
'group' => 1,
'link' => '/admin/customers',
'icon' => 'UserIcon',
'name' => 'Customers',
'owner_only' => false,
'ability' => 'view-customer',
'model' => Customer::class
],
[
'title' => 'navigation.items',
'group' => 1,
'link' => '/admin/items',
'icon' => 'StarIcon',
'name' => 'Items',
'owner_only' => false,
'ability' => 'view-item',
'model' => Item::class
],
[
'title' => 'navigation.estimates',
'group' => 2,
'link' => '/admin/estimates',
'icon' => 'DocumentIcon',
'name' => 'Estimates',
'owner_only' => false,
'ability' => 'view-estimate',
'model' => Estimate::class
],
[
'title' => 'navigation.invoices',
'group' => 2,
'link' => '/admin/invoices',
'icon' => 'DocumentTextIcon',
'name' => 'Invoices',
'owner_only' => false,
'ability' => 'view-invoice',
'model' => Invoice::class
],
[
'title' => 'navigation.recurring-invoices',
'group' => 2,
'link' => '/admin/recurring-invoices',
'icon' => 'DocumentTextIcon',
'name' => 'Recurring Invoices',
'owner_only' => false,
'ability' => 'view-recurring-invoice',
'model' => RecurringInvoice::class
],
[
'title' => 'navigation.payments',
'group' => 2,
'link' => '/admin/payments',
'icon' => 'CreditCardIcon',
'name' => 'Payments',
'owner_only' => false,
'ability' => 'view-payment',
'model' => Payment::class
],
[
'title' => 'navigation.expenses',
'group' => 2,
'link' => '/admin/expenses',
'icon' => 'CalculatorIcon',
'name' => 'Expenses',
'owner_only' => false,
'ability' => 'view-expense',
'model' => Expense::class
],
[
'title' => 'navigation.modules',
'group' => 3,
'link' => '/admin/modules',
'icon' => 'PuzzleIcon',
'name' => 'Modules',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'navigation.users',
'group' => 3,
'link' => '/admin/users',
'icon' => 'UsersIcon',
'name' => 'Users',
'owner_only' => true,
'ability' => '',
'model' => ''
],
[
'title' => 'navigation.reports',
'group' => 3,
'link' => '/admin/reports',
'icon' => 'ChartBarIcon',
'name' => 'Reports',
'owner_only' => false,
'ability' => 'view-financial-reports',
'model' => ''
],
[
'title' => 'navigation.settings',
'group' => 3,
'link' => '/admin/settings',
'icon' => 'CogIcon',
'name' => 'Settings',
'owner_only' => false,
'ability' => '',
'model' => ''
],
],
/*
* List of customer portal menu
*/
'customer_menu' => [
[
'title' => 'Dashboard',
'link' => '/customer/dashboard',
'icon' => '',
'name' => '',
'ability' => '',
'owner_only' => false,
'group' => '',
'model' => ''
],
[
'title' => 'Invoices',
'link' => '/customer/invoices',
'icon' => '',
'name' => '',
'ability' => '',
'owner_only' => false,
'group' => '',
'model' => ''
],
[
'title' => 'Estimates',
'link' => '/customer/estimates',
'icon' => '',
'name' => '',
'owner_only' => false,
'ability' => '',
'group' => '',
'model' => ''
],
[
'title' => 'Payments',
'link' => '/customer/payments',
'icon' => '',
'name' => '',
'owner_only' => false,
'ability' => '',
'group' => '',
'model' => ''
],
[
'title' => 'Settings',
'link' => '/customer/settings',
'icon' => '',
'name' => '',
'owner_only' => false,
'ability' => '',
'group' => '',
'model' => ''
],
],
/*
* List of recurring invoice status
*/
'recurring_invoice_status' => [
'create_status' => [
['key' => 'settings.preferences.active', 'value' => 'ACTIVE'],
['key' => 'settings.preferences.on_hold', 'value' => 'ON_HOLD']
],
'update_status' => [
['key' => 'settings.preferences.active', 'value' => 'ACTIVE'],
['key' => 'settings.preferences.on_hold', 'value' => 'ON_HOLD'],
['key' => 'settings.preferences.completed', 'value' => 'COMPLETED'],
]
],
/*
* List of exchange rate provider (currency converter server's)
*/
'currency_converter_servers' => [
['key' => 'settings.preferences.premium', 'value' => 'PREMIUM'],
['key' => 'settings.preferences.prepaid', 'value' => 'PREPAID'],
['key' => 'settings.preferences.free', 'value' => 'FREE'],
['key' => 'settings.preferences.dedicated', 'value' => 'DEDICATED'],
],
/*
* List of exchange rate drivers
*/
'exchange_rate_drivers' => [
['key' => 'settings.exchange_rate.currency_converter', 'value' => 'currency_converter'],
['key' => 'settings.exchange_rate.currency_freak', 'value' => 'currency_freak'],
['key' => 'settings.exchange_rate.currency_layer', 'value' => 'currency_layer'],
['key' => 'settings.exchange_rate.open_exchange_rate', 'value' => 'open_exchange_rate'],
],
/*
* List of Custom field supported models
*/
'custom_field_models' => [
'Customer',
'Estimate',
'Invoice',
'Payment',
'Expense',
]
];

129
crater/config/database.php Normal file
View File

@@ -0,0 +1,129 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => false,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| 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 in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
'read_write_timeout' => 60,
],
'cache' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
],
];

244
crater/config/dompdf.php Normal file
View File

@@ -0,0 +1,244 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Settings
|--------------------------------------------------------------------------
|
| Set some default values. It is possible to add all defines that can be set
| in dompdf_config.inc.php. You can also override the entire config file.
|
*/
'show_warnings' => false, // Throw an Exception on warnings from dompdf
'orientation' => 'portrait',
'defines' => [
/**
* The location of the DOMPDF font directory
*
* The location of the directory where DOMPDF will store fonts and font metrics
* Note: This directory must exist and be writable by the webserver process.
* *Please note the trailing slash.*
*
* Notes regarding fonts:
* Additional .afm font metrics can be added by executing load_font.php from command line.
*
* Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
* be embedded in the pdf file or the PDF may not display correctly. This can significantly
* increase file size unless font subsetting is enabled. Before embedding a font please
* review your rights under the font license.
*
* Any font specification in the source HTML is translated to the closest font available
* in the font directory.
*
* The pdf standard "Base 14 fonts" are:
* Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
* Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
* Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
* Symbol, ZapfDingbats.
*/
"font_dir" => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
/**
* The location of the DOMPDF font cache directory
*
* This directory contains the cached font metrics for the fonts used by DOMPDF.
* This directory can be the same as DOMPDF_FONT_DIR
*
* Note: This directory must exist and be writable by the webserver process.
*/
"font_cache" => storage_path('fonts/'),
/**
* The location of a temporary directory.
*
* The directory specified must be writeable by the webserver process.
* The temporary directory is required to download remote images and when
* using the PFDLib back end.
*/
"temp_dir" => sys_get_temp_dir(),
/**
* ==== IMPORTANT ====
*
* dompdf's "chroot": Prevents dompdf from accessing system files or other
* files on the webserver. All local files opened by dompdf must be in a
* subdirectory of this directory. DO NOT set it to '/' since this could
* allow an attacker to use dompdf to read any files on the server. This
* should be an absolute path.
* This is only checked on command line call by dompdf.php, but not by
* direct class use like:
* $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
*/
"chroot" => realpath(base_path()),
/**
* Whether to enable font subsetting or not.
*/
"enable_font_subsetting" => false,
/**
* The PDF rendering backend to use
*
* Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
* 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will
* fall back on CPDF. 'GD' renders PDFs to graphic files. {@link
* Canvas_Factory} ultimately determines which rendering class to instantiate
* based on this setting.
*
* Both PDFLib & CPDF rendering backends provide sufficient rendering
* capabilities for dompdf, however additional features (e.g. object,
* image and font support, etc.) differ between backends. Please see
* {@link PDFLib_Adapter} for more information on the PDFLib backend
* and {@link CPDF_Adapter} and lib/class.pdf.php for more information
* on CPDF. Also see the documentation for each backend at the links
* below.
*
* The GD rendering backend is a little different than PDFLib and
* CPDF. Several features of CPDF and PDFLib are not supported or do
* not make any sense when creating image files. For example,
* multiple pages are not supported, nor are PDF 'objects'. Have a
* look at {@link GD_Adapter} for more information. GD support is
* experimental, so use it at your own risk.
*
* @link http://www.pdflib.com
* @link http://www.ros.co.nz/pdf
* @link http://www.php.net/image
*/
"pdf_backend" => "CPDF",
/**
* PDFlib license key
*
* If you are using a licensed, commercial version of PDFlib, specify
* your license key here. If you are using PDFlib-Lite or are evaluating
* the commercial version of PDFlib, comment out this setting.
*
* @link http://www.pdflib.com
*
* If pdflib present in web server and auto or selected explicitly above,
* a real license code must exist!
*/
//"DOMPDF_PDFLIB_LICENSE" => "your license key here",
/**
* html target media view which should be rendered into pdf.
* List of types and parsing rules for future extensions:
* http://www.w3.org/TR/REC-html40/types.html
* screen, tty, tv, projection, handheld, print, braille, aural, all
* Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
* Note, even though the generated pdf file is intended for print output,
* the desired content might be different (e.g. screen or projection view of html file).
* Therefore allow specification of content here.
*/
"default_media_type" => "screen",
/**
* The default paper size.
*
* North America standard is "letter"; other countries generally "a4"
*
* @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
*/
"default_paper_size" => "a4",
/**
* The default font family
*
* Used if no suitable fonts can be found. This must exist in the font folder.
* @var string
*/
"default_font" => "DejaVu Sans",
/**
* Image DPI setting
*
* This setting determines the default DPI setting for images and fonts. The
* DPI may be overridden for inline images by explicitly setting the
* image's width & height style attributes (i.e. if the image's native
* width is 600 pixels and you specify the image's width as 72 points,
* the image will have a DPI of 600 in the rendered PDF. The DPI of
* background images can not be overridden and is controlled entirely
* via this parameter.
*
* For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
* If a size in html is given as px (or without unit as image size),
* this tells the corresponding size in pt.
* This adjusts the relative sizes to be similar to the rendering of the
* html page in a reference browser.
*
* In pdf, always 1 pt = 1/72 inch
*
* Rendering resolution of various browsers in px per inch:
* Windows Firefox and Internet Explorer:
* SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
* Linux Firefox:
* about:config *resolution: Default:96
* (xorg screen dimension in mm and Desktop font dpi settings are ignored)
*
* Take care about extra font/image zoom factor of browser.
*
* In images, <img> size in pixel attribute, img css style, are overriding
* the real image dimension in px for rendering.
*
* @var int
*/
"dpi" => 96,
/**
* Enable inline PHP
*
* If this setting is set to true then DOMPDF will automatically evaluate
* inline PHP contained within <script type="text/php"> ... </script> tags.
*
* Enabling this for documents you do not trust (e.g. arbitrary remote html
* pages) is a security risk. Set this option to false if you wish to process
* untrusted documents.
*
* @var bool
*/
"enable_php" => false,
/**
* Enable inline Javascript
*
* If this setting is set to true then DOMPDF will automatically insert
* JavaScript code contained within <script type="text/javascript"> ... </script> tags.
*
* @var bool
*/
"enable_javascript" => true,
/**
* Enable remote file access
*
* If this setting is set to true, DOMPDF will access remote sites for
* images and CSS files as required.
* This is required for part of test case www/test/image_variants.html through www/examples.php
*
* Attention!
* This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and
* allowing remote access to dompdf.php or on allowing remote html code to be passed to
* $dompdf = new DOMPDF(, $dompdf->load_html(...,
* This allows anonymous users to download legally doubtful internet content which on
* tracing back appears to being downloaded by your server, or allows malicious php code
* in remote html pages to be executed by your server with your account privileges.
*
* @var bool
*/
"enable_remote" => true,
/**
* A ratio applied to the fonts height to be more like browsers' line height
*/
"font_height_ratio" => 1.1,
/**
* Use the more-than-experimental HTML5 Lib parser
*/
"enable_html5_parser" => true,
],
];

View File

@@ -0,0 +1,116 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
'root' => env('AWS_ROOT'),
],
'media' => [
'driver' => 'local',
'root' => public_path('media'),
],
'doSpaces' => [
'type' => 'AwsS3',
'driver' => 's3',
'key' => env('DO_SPACES_KEY'),
'secret' => env('DO_SPACES_SECRET'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET'),
'root' => env('DO_SPACES_ROOT'),
'endpoint' => env('DO_SPACES_ENDPOINT'),
'use_path_style_endpoint' => false,
],
'dropbox' => [
'driver' => 'dropbox',
'type' => 'DropboxV2',
'token' => env('DROPBOX_TOKEN'),
'key' => env('DROPBOX_KEY'),
'secret' => env('DROPBOX_SECRET'),
'app' => env('DROPBOX_APP'),
'root' => env('DROPBOX_ROOT'),
],
'views' => [
'driver' => 'local',
'root' => resource_path('views'),
],
],
/*
|--------------------------------------------------------------------------
| 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'),
],
];

77
crater/config/hashids.php Normal file
View File

@@ -0,0 +1,77 @@
<?php
/**
* Copyright (c) Vincent Klaiber.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/vinkla/laravel-hashids
*/
use Crater\Models\Company;
use Crater\Models\EmailLog;
use Crater\Models\Estimate;
use Crater\Models\Invoice;
use Crater\Models\Payment;
use Crater\Models\Transaction;
return [
/*
|--------------------------------------------------------------------------
| Default Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the connections below you wish to use as
| your default connection for all work. Of course, you may use many
| connections at once using the manager class.
|
*/
'default' => 'main',
/*
|--------------------------------------------------------------------------
| Hashids Connections
|--------------------------------------------------------------------------
|
| Here are each of the connections setup for your application. Example
| configuration has been included, but you may add as many connections as
| you would like.
|
*/
'connections' => [
Invoice::class => [
'salt' => Invoice::class.config('app.key'),
'length' => '20',
'alphabet' => 'XKyIAR7mgt8jD2vbqPrOSVenNGpiYLx4M61T',
],
Estimate::class => [
'salt' => Estimate::class.config('app.key'),
'length' => '20',
'alphabet' => 'yLJWP79M8rYVqbn1NXjulO6IUDdvekRQGo40',
],
Payment::class => [
'salt' => Payment::class.config('app.key'),
'length' => '20',
'alphabet' => 'asqtW3eDRIxB65GYl7UVLS1dybn9XrKTZ4zO',
],
Company::class => [
'salt' => Company::class.config('app.key'),
'length' => '20',
'alphabet' => 's0DxOFtEYEnuKPmP08Ch6A1iHlLmBTBVWms5',
],
EmailLog::class => [
'salt' => EmailLog::class.config('app.key'),
'length' => '20',
'alphabet' => 'BRAMEz5str5UVe9oCqzoYY2oKgUi8wQQSmrR',
],
Transaction::class => [
'salt' => Transaction::class.config('app.key'),
'length' => '20',
'alphabet' => 'ADyQWE8mgt7jF2vbnPrKLJenHVpiUIq4M12T',
],
],
];

45
crater/config/hashing.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

20
crater/config/image.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
|
| Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => 'gd',
];

51
crater/config/installer.php Executable file
View File

@@ -0,0 +1,51 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Server Requirements
|--------------------------------------------------------------------------
|
| This is the default Laravel server requirements, you can add as many
| as your application require, we check if the extension is enabled
| by looping through the array and run "extension_loaded" on it.
|
*/
'core' => [
'minPhpVersion' => '7.4.0',
],
'final' => [
'key' => true,
'publish' => false,
],
'requirements' => [
'php' => [
'openssl',
'pdo',
'mbstring',
'tokenizer',
'JSON',
'cURL',
'zip',
],
'apache' => [
'mod_rewrite',
],
],
/*
|--------------------------------------------------------------------------
| Folders Permissions
|--------------------------------------------------------------------------
|
| This is the default Laravel folders permissions, if your application
| requires more permissions just add them to the array list below.
|
*/
'permissions' => [
'storage/framework/' => '775',
'storage/logs/' => '775',
'bootstrap/cache/' => '775',
],
];

80
crater/config/logging.php Normal file
View File

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

146
crater/config/mail.php Normal file
View File

@@ -0,0 +1,146 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill",
| "ses", "sparkpost", "log"
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 587),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails 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 e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'admin@crater.in'),
'name' => env('MAIL_FROM_NAME', 'Crater'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),
];

View File

@@ -0,0 +1,166 @@
<?php
return [
/*
* The disk on which to store added files and derived images by default. Choose
* one or more of the disks you've configured in config/filesystems.php.
*/
'disk_name' => env('MEDIA_DISK', 'public'),
/*
* The maximum file size of an item in bytes.
* Adding a larger file will result in an exception.
*/
'max_file_size' => 1024 * 1024 * 10,
/*
* This queue will be used to generate derived and responsive images.
* Leave empty to use the default queue.
*/
'queue_name' => '',
/*
* The fully qualified class name of the media model.
*/
'media_model' => Spatie\MediaLibrary\MediaCollections\Models\Media::class,
'remote' => [
/*
* Any extra headers that should be included when uploading media to
* a remote disk. Even though supported headers may vary between
* different drivers, a sensible default has been provided.
*
* Supported by S3: CacheControl, Expires, StorageClass,
* ServerSideEncryption, Metadata, ACL, ContentEncoding
*/
'extra_headers' => [
'CacheControl' => 'max-age=604800',
],
],
'responsive_images' => [
/*
* This class is responsible for calculating the target widths of the responsive
* images. By default we optimize for filesize and create variations that each are 20%
* smaller than the previous one. More info in the documentation.
*
* https://docs.spatie.be/laravel-medialibrary/v8/advanced-usage/generating-responsive-images
*/
'width_calculator' => Spatie\MediaLibrary\ResponsiveImages\WidthCalculator\FileSizeOptimizedWidthCalculator::class,
/*
* By default rendering media to a responsive image will add some javascript and a tiny placeholder.
* This ensures that the browser can already determine the correct layout.
*/
'use_tiny_placeholders' => true,
/*
* This class will generate the tiny placeholder used for progressive image loading. By default
* the medialibrary will use a tiny blurred jpg image.
*/
'tiny_placeholder_generator' => Spatie\MediaLibrary\ResponsiveImages\TinyPlaceholderGenerator\Blurred::class,
],
/*
* When converting Media instances to response the medialibrary will add
* a `loading` attribute to the `img` tag. Here you can set the default
* value of that attribute.
*
* Possible values: 'auto', 'lazy' and 'eager,
*
* More info: https://css-tricks.com/native-lazy-loading/
*/
'default_loading_attribute_value' => 'auto',
/*
* This is the class that is responsible for naming conversion files. By default,
* it will use the filename of the original and concatenate the conversion name to it.
*/
'conversion_file_namer' => \Spatie\MediaLibrary\Conversions\DefaultConversionFileNamer::class,
/*
* The class that contains the strategy for determining a media file's path.
*/
'path_generator' => \Crater\Generators\CustomPathGenerator::class,
/*
* When urls to files get generated, this class will be called. Use the default
* if your files are stored locally above the site root or on s3.
*/
'url_generator' => Spatie\MediaLibrary\Support\UrlGenerator\DefaultUrlGenerator::class,
/*
* Whether to activate versioning when urls to files get generated.
* When activated, this attaches a ?v=xx query string to the URL.
*/
'version_urls' => false,
/*
* The media library will try to optimize all converted images by removing
* metadata and applying a little bit of compression. These are
* the optimizers that will be used by default.
*/
'image_optimizers' => [
Spatie\ImageOptimizer\Optimizers\Jpegoptim::class => [
'--strip-all', // this strips out all text information such as comments and EXIF data
'--all-progressive', // this will make sure the resulting image is a progressive one
],
Spatie\ImageOptimizer\Optimizers\Pngquant::class => [
'--force', // required parameter for this package
],
Spatie\ImageOptimizer\Optimizers\Optipng::class => [
'-i0', // this will result in a non-interlaced, progressive scanned image
'-o2', // this set the optimization level to two (multiple IDAT compression trials)
'-quiet', // required parameter for this package
],
Spatie\ImageOptimizer\Optimizers\Svgo::class => [
'--disable=cleanupIDs', // disabling because it is known to cause troubles
],
Spatie\ImageOptimizer\Optimizers\Gifsicle::class => [
'-b', // required parameter for this package
'-O3', // this produces the slowest but best results
],
],
/*
* These generators will be used to create an image of media files.
*/
'image_generators' => [
Spatie\MediaLibrary\Conversions\ImageGenerators\Image::class,
Spatie\MediaLibrary\Conversions\ImageGenerators\Webp::class,
Spatie\MediaLibrary\Conversions\ImageGenerators\Pdf::class,
Spatie\MediaLibrary\Conversions\ImageGenerators\Svg::class,
Spatie\MediaLibrary\Conversions\ImageGenerators\Video::class,
],
/*
* The engine that should perform the image conversions.
* Should be either `gd` or `imagick`.
*/
'image_driver' => env('IMAGE_DRIVER', 'gd'),
/*
* FFMPEG & FFProbe binaries paths, only used if you try to generate video
* thumbnails and have installed the php-ffmpeg/php-ffmpeg composer
* dependency.
*/
'ffmpeg_path' => env('FFMPEG_PATH', '/usr/bin/ffmpeg'),
'ffprobe_path' => env('FFPROBE_PATH', '/usr/bin/ffprobe'),
/*
* The path where to store temporary files while performing image conversions.
* If set to null, storage_path('media-library/temp') will be used.
*/
'temporary_directory_path' => null,
/*
* Here you can override the class names of the jobs used by this package. Make sure
* your custom jobs extend the ones provided by the package.
*/
'jobs' => [
'perform_conversions' => \Spatie\MediaLibrary\Conversions\Jobs\PerformConversionsJob::class,
'generate_responsive_images' => \Spatie\MediaLibrary\ResponsiveImages\Jobs\GenerateResponsiveImagesJob::class,
],
];

286
crater/config/modules.php Normal file
View File

@@ -0,0 +1,286 @@
<?php
use Nwidart\Modules\Activators\FileActivator;
use Nwidart\Modules\Commands;
return [
/*
|--------------------------------------------------------------------------
| Module Namespace
|--------------------------------------------------------------------------
|
| Default module namespace.
|
*/
'namespace' => 'Modules',
/*
|--------------------------------------------------------------------------
| Module Stubs
|--------------------------------------------------------------------------
|
| Default module stubs.
|
*/
'stubs' => [
'enabled' => false,
'path' => base_path('vendor/nwidart/laravel-modules/src/Commands/stubs'),
'files' => [
'routes/web' => 'Routes/web.php',
'routes/api' => 'Routes/api.php',
'views/index' => 'Resources/views/index.blade.php',
'views/master' => 'Resources/views/layouts/master.blade.php',
'scaffold/config' => 'Config/config.php',
'composer' => 'composer.json',
'resources/scripts/module' => 'Resources/scripts/module.js',
'resources/sass/module' => 'Resources/sass/module.scss',
'resources/scripts/stores/sample-store' => 'Resources/scripts/stores/sample-store.js',
'resources/scripts/views/SamplePage' => 'Resources/scripts/views/SamplePage.vue',
'resources/locales/en' => 'Resources/locales/en.json',
'resources/locales/locales' => 'Resources/locales/locales.js',
'package' => 'package.json',
'postcss.config' => 'postcss.config.js',
'tailwind.config' => 'tailwind.config.js',
'vite.config' => 'vite.config.js',
],
'replacements' => [
'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'],
'routes/api' => ['LOWER_NAME'],
'webpack' => ['LOWER_NAME'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'],
'views/index' => ['LOWER_NAME'],
'views/master' => ['LOWER_NAME', 'STUDLY_NAME'],
'scaffold/config' => ['STUDLY_NAME'],
'composer' => [
'LOWER_NAME',
'STUDLY_NAME',
'VENDOR',
'AUTHOR_NAME',
'AUTHOR_EMAIL',
'MODULE_NAMESPACE',
'PROVIDER_NAMESPACE',
],
'assets/scripts/module' => ['LOWER_NAME'],
'assets/scripts/stores/sample-store' => ['LOWER_NAME'],
'vite.config' => ['LOWER_NAME'],
],
'gitkeep' => true,
],
'paths' => [
/*
|--------------------------------------------------------------------------
| Modules path
|--------------------------------------------------------------------------
|
| This path used for save the generated module. This path also will be added
| automatically to list of scanned folders.
|
*/
'modules' => base_path('Modules'),
/*
|--------------------------------------------------------------------------
| Modules assets path
|--------------------------------------------------------------------------
|
| Here you may update the modules assets path.
|
*/
'assets' => public_path('modules'),
/*
|--------------------------------------------------------------------------
| The migrations path
|--------------------------------------------------------------------------
|
| Where you run 'module:publish-migration' command, where do you publish the
| the migration files?
|
*/
'migration' => base_path('database/migrations'),
/*
|--------------------------------------------------------------------------
| Generator path
|--------------------------------------------------------------------------
| Customise the paths where the folders will be generated.
| Set the generate key to false to not generate that folder
*/
'generator' => [
'config' => ['path' => 'Config', 'generate' => true],
'command' => ['path' => 'Console', 'generate' => true],
'migration' => ['path' => 'Database/Migrations', 'generate' => true],
'seeder' => ['path' => 'Database/Seeders', 'generate' => true],
'factory' => ['path' => 'Database/factories', 'generate' => true],
'model' => ['path' => 'Entities', 'generate' => true],
'routes' => ['path' => 'Routes', 'generate' => true],
'controller' => ['path' => 'Http/Controllers', 'generate' => true],
'filter' => ['path' => 'Http/Middleware', 'generate' => true],
'request' => ['path' => 'Http/Requests', 'generate' => true],
'provider' => ['path' => 'Providers', 'generate' => true],
'assets' => ['path' => 'Resources/assets', 'generate' => true],
'lang' => ['path' => 'Resources/lang', 'generate' => true],
'views' => ['path' => 'Resources/views', 'generate' => true],
'test' => ['path' => 'Tests/Unit', 'generate' => true],
'test-feature' => ['path' => 'Tests/Feature', 'generate' => true],
'repository' => ['path' => 'Repositories', 'generate' => false],
'event' => ['path' => 'Events', 'generate' => false],
'listener' => ['path' => 'Listeners', 'generate' => false],
'policies' => ['path' => 'Policies', 'generate' => false],
'rules' => ['path' => 'Rules', 'generate' => false],
'jobs' => ['path' => 'Jobs', 'generate' => false],
'emails' => ['path' => 'Emails', 'generate' => false],
'notifications' => ['path' => 'Notifications', 'generate' => false],
'resource' => ['path' => 'Transformers', 'generate' => false],
'component-view' => ['path' => 'Resources/views/components', 'generate' => false],
'component-class' => ['path' => 'View/Components', 'generate' => false],
],
],
/*
|--------------------------------------------------------------------------
| Package commands
|--------------------------------------------------------------------------
|
| Here you can define which commands will be visible and used in your
| application. If for example you don't use some of the commands provided
| you can simply comment them out.
|
*/
'commands' => [
Commands\CommandMakeCommand::class,
Commands\ComponentClassMakeCommand::class,
Commands\ComponentViewMakeCommand::class,
Commands\ControllerMakeCommand::class,
Commands\DisableCommand::class,
Commands\DumpCommand::class,
Commands\EnableCommand::class,
Commands\EventMakeCommand::class,
Commands\JobMakeCommand::class,
Commands\ListenerMakeCommand::class,
Commands\MailMakeCommand::class,
Commands\MiddlewareMakeCommand::class,
Commands\NotificationMakeCommand::class,
Commands\ProviderMakeCommand::class,
Commands\RouteProviderMakeCommand::class,
Commands\InstallCommand::class,
Commands\ListCommand::class,
Commands\ModuleDeleteCommand::class,
Commands\ModuleMakeCommand::class,
Commands\FactoryMakeCommand::class,
Commands\PolicyMakeCommand::class,
Commands\RequestMakeCommand::class,
Commands\RuleMakeCommand::class,
Commands\MigrateCommand::class,
Commands\MigrateRefreshCommand::class,
Commands\MigrateResetCommand::class,
Commands\MigrateRollbackCommand::class,
Commands\MigrateStatusCommand::class,
Commands\MigrationMakeCommand::class,
Commands\ModelMakeCommand::class,
Commands\PublishCommand::class,
Commands\PublishConfigurationCommand::class,
Commands\PublishMigrationCommand::class,
Commands\PublishTranslationCommand::class,
Commands\SeedCommand::class,
Commands\SeedMakeCommand::class,
Commands\SetupCommand::class,
Commands\UnUseCommand::class,
Commands\UpdateCommand::class,
Commands\UseCommand::class,
Commands\ResourceMakeCommand::class,
Commands\TestMakeCommand::class,
Commands\LaravelModulesV6Migrator::class,
Commands\ComponentClassMakeCommand::class,
Commands\ComponentViewMakeCommand::class,
],
/*
|--------------------------------------------------------------------------
| Scan Path
|--------------------------------------------------------------------------
|
| Here you define which folder will be scanned. By default will scan vendor
| directory. This is useful if you host the package in packagist website.
|
*/
'scan' => [
'enabled' => false,
'paths' => [
base_path('vendor/*/*'),
],
],
/*
|--------------------------------------------------------------------------
| Composer File Template
|--------------------------------------------------------------------------
|
| Here is the config for composer.json file, generated by this package
|
*/
'composer' => [
'vendor' => 'nwidart',
'author' => [
'name' => 'Nicolas Widart',
'email' => 'n.widart@gmail.com',
],
'composer-output' => false,
],
/*
|--------------------------------------------------------------------------
| Caching
|--------------------------------------------------------------------------
|
| Here is the config for setting up caching feature.
|
*/
'cache' => [
'enabled' => false,
'key' => 'laravel-modules',
'lifetime' => 60,
],
/*
|--------------------------------------------------------------------------
| Choose what laravel-modules will register as custom namespaces.
| Setting one to false will require you to register that part
| in your own Service Provider class.
|--------------------------------------------------------------------------
*/
'register' => [
'translations' => true,
/**
* load files on boot or register method
*
* Note: boot not compatible with asgardcms
*
* @example boot|register
*/
'files' => 'register',
],
/*
|--------------------------------------------------------------------------
| Activators
|--------------------------------------------------------------------------
|
| You can define new types of activators here, file, database etc. The only
| required parameter is 'class'.
| The file activator will store the activation status in storage/installed_modules
*/
'activators' => [
'file' => [
'class' => FileActivator::class,
'statuses-file' => base_path('storage/app/modules_statuses.json'),
'cache-key' => 'activator.installed',
'cache-lifetime' => 604800,
],
],
'activator' => 'file',
];

85
crater/config/queue.php Normal file
View File

@@ -0,0 +1,85 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Driver
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for each one. Here you may set the default queue driver.
|
| Supported: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
],
'sqs' => [
'driver' => 'sqs',
'key' => 'your-public-key',
'secret' => 'your-secret-key',
'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
'queue' => 'your-queue-name',
'region' => 'us-east-1',
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => 'default',
'retry_after' => 90,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];

47
crater/config/sanctum.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', 'localhost,127.0.0.1,127.0.0.1:8000,::1')),
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. If this value is null, personal access tokens do
| not expire. This won't tweak the lifetime of first-party sessions.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'verify_csrf_token' => Crater\Http\Middleware\VerifyCsrfToken::class,
'encrypt_cookies' => Crater\Http\Middleware\EncryptCookies::class,
],
];

View File

@@ -0,0 +1,68 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, SparkPost and others. This file provides a sane
| default location for this type of information, allowing packages
| to have a conventional place to find your various credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'ses' => [
'key' => env('SES_KEY'),
'secret' => env('SES_SECRET'),
'region' => 'us-east-1',
],
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
],
'sendgrid' => [
'api_key' => env('SENDGRID_API_KEY'),
],
'stripe' => [
'model' => \Crater\Models\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET'),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
],
],
'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
'redirect' => env('FACEBOOK_REDIRECT_URL'),
],
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => env('GOOGLE_REDIRECT_URL'),
],
'github' => [
'client_id' => env('GITHUB_CLIENT_ID'),
'client_secret' => env('GITHUB_CLIENT_SECRET'),
'redirect' => env('GITHUB_REDIRECT_URL'),
],
'cron_job' => [
'auth_token' => env('CRON_JOB_AUTH_TOKEN', 0)
],
];

199
crater/config/session.php Normal file
View File

@@ -0,0 +1,199 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| 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 immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'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', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| 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 cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'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 are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| 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 if it can not 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. You are free to modify this option if needed.
|
*/
'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" since this is a secure default value.
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => 'lax',
];

View File

@@ -0,0 +1,50 @@
<?php
return [
/*
* Set trusted proxy IP addresses.
*
* Both IPv4 and IPv6 addresses are
* supported, along with CIDR notation.
*
* The "*" character is syntactic sugar
* within TrustedProxy to trust any proxy
* that connects directly to your server,
* a requirement when you cannot know the address
* of your proxy (e.g. if using ELB or similar).
*
*/
// 'proxies' => null, // [<ip addresses>,], '*', '<ip addresses>,'
/*
* To trust one or more specific proxies that connect
* directly to your server, use an array or a string separated by comma of IP addresses:
*/
// 'proxies' => ['192.168.1.1'],
// 'proxies' => '192.168.1.1, 192.168.1.2',
/*
* Or, to trust all proxies that connect
* directly to your server, use a "*"
*/
'proxies' => env('TRUSTED_PROXIES', '*'),
/*
* Which headers to use to detect proxy related data (For, Host, Proto, Port)
*
* Options include:
*
* - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
* - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
* - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer)
*
* - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust)
* - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust)
* - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer)
*
* @link https://symfony.com/doc/current/deployment/proxies.html
*/
'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
];

33
crater/config/view.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => realpath(storage_path('framework/views')),
];

67
crater/config/vite.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Entrypoints
|--------------------------------------------------------------------------
| The files in the configured directories will be considered
| entry points and will not be required in the configuration file.
| To disable the feature, set to false.
*/
'entrypoints' => [
'resources/scripts/main.js',
],
'ignore_patterns' => ["/\.d\.ts$/"],
/*
|--------------------------------------------------------------------------
| Aliases
|--------------------------------------------------------------------------
| These aliases will be added to the Vite configuration and used
| to generate a proper tsconfig.json file.
*/
'aliases' => [
'@' => 'resources',
],
/*
|--------------------------------------------------------------------------
| Static assets path
|--------------------------------------------------------------------------
| This option defines the directory that Vite considers as the
| public directory. Its content will be copied to the build directory
| at build-time.
| https://vitejs.dev/config/#publicdir
*/
'public_directory' => resource_path('static'),
/*
|--------------------------------------------------------------------------
| Ping timeout
|--------------------------------------------------------------------------
| The maximum duration, in seconds, that the ping to the development
| server should take while trying to determine whether to use the
| manifest or the server in a local environment.
*/
'ping_timeout' => .1,
/*
|--------------------------------------------------------------------------
| Build path
|--------------------------------------------------------------------------
| The directory, relative to /public, in which Vite will build
| the production files. This should match "build.outDir" in the Vite
| configuration file.
*/
'build_path' => 'build',
/*
|--------------------------------------------------------------------------
| Development URL
|--------------------------------------------------------------------------
| The URL at which the Vite development server runs.
| This is used to generate the script tags when developing.
*/
'dev_url' => 'http://localhost:3000',
];