Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
4c007ae085
4 changed files with 125 additions and 1 deletions
|
@ -33,6 +33,10 @@ class UserFilesController extends Controller
|
|||
|
||||
$logActions = [];
|
||||
$files = $request->file('file');
|
||||
|
||||
if (is_null($files)){
|
||||
return redirect()->back()->with('error', trans('admin/users/message.upload.nofiles'));
|
||||
}
|
||||
foreach($files as $file) {
|
||||
$extension = $file->getClientOriginalExtension();
|
||||
$filename = 'user-' . $user->id . '-' . str_random(8);
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSerialNumberIndexes extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function (Blueprint $table) {
|
||||
$table->index(['serial']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('assets', function (Blueprint $table) {
|
||||
$table->dropIndex(['serial']);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCompanyIdIndexes extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('accessories', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('action_logs', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('assets', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('components', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('consumables', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('departments', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('licenses', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('licenses', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('departments', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('consumables', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('components', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('assets', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('action_logs', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
|
||||
Schema::table('accessories', function (Blueprint $table) {
|
||||
$table->dropIndex(['company_id']);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
<label class="btn btn-default">
|
||||
{{ trans('button.select_file') }}
|
||||
<input type="file" name="file[]" multiple="true" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/*,.csv,.zip,.rar,.doc,.docx,.xls,.xlsx,.xml,.lic,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain,.pdf,application/rtf" style="display:none">
|
||||
<input type="file" name="file[]" multiple="true" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/*,.csv,.zip,.rar,.doc,.docx,.xls,.xlsx,.xml,.lic,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain,.pdf,application/rtf" style="display:none" required>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue