Add attachments, more pages
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tyler
2020-12-26 19:34:07 -05:00
parent d086b29bcc
commit a1ac81a73a
29 changed files with 2349 additions and 17899 deletions

98
config/attachments.php Normal file
View File

@ -0,0 +1,98 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Determine whether or not to automatically define attachments routes.
| Used for local storage only as other storage should define their public URL.
|
*/
'routes' => [
'publish' => true,
'prefix' => 'attachments',
'middleware' => 'web',
'pattern' => '/{id}/{name}',
'shared_pattern' => '/shared/{token}',
'dropzone' => [
'upload_pattern' => '/dropzone',
'delete_pattern' => '/dropzone/{id}',
]
],
/*
|--------------------------------------------------------------------------
| Model
|--------------------------------------------------------------------------
|
| Attachment model used
|
*/
'attachment_model' => env('ATTACHMENTS_MODEL', \Bnb\Laravel\Attachments\Attachment::class),
/*
|--------------------------------------------------------------------------
| Uuid
|--------------------------------------------------------------------------
|
| Default attachment model uses an UUID column. You can define your own UUID
| generator here : a global function name or a static class method in the form :
| App\Namespace\ClassName@method
|
*/
'uuid_provider' => 'uuid_v4_base36',
/*
|--------------------------------------------------------------------------
| Behaviors
|--------------------------------------------------------------------------
|
| Configurable behaviors :
| - Concrete files can be delete when the database entry is deleted
| - Dropzone delete can check for CSRF token match (set on upload)
|
*/
'behaviors' => [
'cascade_delete' => env('ATTACHMENTS_CASCADE_DELETE', true),
'dropzone_check_csrf' => env('ATTACHMENTS_DROPZONE_CHECK_CSRF', true),
],
/*
|--------------------------------------------------------------------------
| Declare the attachment model attributes
|--------------------------------------------------------------------------
|
| This allow to extend the attachment model with new columns
| `dropzone_attributes` holds the public fields returned after a successful upload via DropzoneController
|
*/
'attributes' => ['title', 'description', 'key', 'disk', 'filepath', 'group'],
'dropzone_attributes' => ['uuid', 'url', 'url_inline', 'filename', 'filetype', 'filesize', 'title', 'description', 'key', 'group'],
/*
|--------------------------------------------------------------------------
| Attachment Storage Directory
|--------------------------------------------------------------------------
|
| Defines the directory prefix where new attachment files are stored
|
*/
'storage_directory' => [
'prefix' => rtrim(env('ATTACHMENTS_STORAGE_DIRECTORY_PREFIX', 'attachments'), '/'),
],
/*
|--------------------------------------------------------------------------
| Database configuration
|--------------------------------------------------------------------------
|
| Allows to set the database connection name for the module's models
|
*/
'database' => [
'connection' => env('ATTACHMENTS_DATABASE_CONNECTION'),
],
];

106
config/scout.php Normal file
View File

@ -0,0 +1,106 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Search Engine
|--------------------------------------------------------------------------
|
| This option controls the default search connection that gets used while
| using Laravel Scout. This connection is used when syncing all models
| to the search service. You should adjust this based on your needs.
|
| Supported: "algolia", "null"
|
*/
'driver' => env('SCOUT_DRIVER', 'elastic'),
/*
|--------------------------------------------------------------------------
| Index Prefix
|--------------------------------------------------------------------------
|
| Here you may specify a prefix that will be applied to all search index
| names used by Scout. This prefix may be useful if you have multiple
| "tenants" or applications sharing the same search infrastructure.
|
*/
'prefix' => env('SCOUT_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Queue Data Syncing
|--------------------------------------------------------------------------
|
| This option allows you to control if the operations that sync your data
| with your search engines are queued. When this is set to "true" then
| all automatic data syncing will get queued for better performance.
|
*/
'queue' => env('SCOUT_QUEUE', false),
/*
|--------------------------------------------------------------------------
| Chunk Sizes
|--------------------------------------------------------------------------
|
| These options allow you to control the maximum chunk size when you are
| mass importing data into the search engine. This allows you to fine
| tune each of these chunk sizes based on the power of the servers.
|
*/
'chunk' => [
'searchable' => 500,
'unsearchable' => 500,
],
/*
|--------------------------------------------------------------------------
| Soft Deletes
|--------------------------------------------------------------------------
|
| This option allows to control whether to keep soft deleted records in
| the search indexes. Maintaining soft deleted records can be useful
| if your application still needs to search for the records later.
|
*/
'soft_delete' => false,
/*
|--------------------------------------------------------------------------
| Identify User
|--------------------------------------------------------------------------
|
| This option allows you to control whether to notify the search engine
| of the user performing the search. This is sometimes useful if the
| engine supports any analytics based on this application's users.
|
| Supported engines: "algolia"
|
*/
'identify' => env('SCOUT_IDENTIFY', false),
/*
|--------------------------------------------------------------------------
| Algolia Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your Algolia settings. Algolia is a cloud hosted
| search engine which works great with Scout out of the box. Just plug
| in your application ID and admin API key to get started searching.
|
*/
'algolia' => [
'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET', ''),
],
];

12
config/scout_elastic.php Normal file
View File

@ -0,0 +1,12 @@
<?php
return [
'client' => [
'hosts' => [
env('SCOUT_ELASTIC_HOST', 'localhost:9200'),
],
],
'update_mapping' => env('SCOUT_ELASTIC_UPDATE_MAPPING', true),
'indexer' => env('SCOUT_ELASTIC_INDEXER', 'single'),
'document_refresh' => env('SCOUT_ELASTIC_DOCUMENT_REFRESH'),
];