FEATURE #1337: add file upload

This commit registers new items into admin menu and adds functionality for uploading files.
This commit is contained in:
Michal Kváček
2016-02-08 14:27:43 +01:00
parent 58a3386277
commit 24144f6aa4
19 changed files with 489 additions and 53 deletions
@@ -0,0 +1,60 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddExtendedFileInfo extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('files', function (Blueprint $table) {
$table->string('original_filename')
->after('filename')->comment = 'Original filename of uploaded file';
$table->text('description')
->nullable();
$table->string('keywords')
->nullable()
->index('keywords_idx');
$table->string('directory')
->default('/')
->index('directory_idx')->comment = 'Not real directory on FS, only virtual one - used for better user orientation in large file collections';
$table->index('filename');
$table->string('filename', 128)
->comment('Filename of localy stored file')
->change();
$table->timestamp('updated_at')
->nullable()
->after('created_at');
$table->renameColumn('sha256_hash', 'file_hash');
$table->string('hash_algorithm', '16')
->after('sha256_hash');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('files', function (Blueprint $table) {
$table->dropColumn([
'original_filename',
'description',
'keywords',
'directory',
'updated_at',
'hash_algorithm'
]);
$table->dropIndex('files_filename_index');
$table->renameColumn('file_hash', 'sha256_hash');
});
}
}