This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| computed: { | |
| pages() { | |
| let pages = []; | |
| let from = this.pagination.current_page - Math.floor(this.offset / 2); | |
| if (from < 1) { | |
| from = 1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div v-if="file.type == 'document'" class="document_block"> | |
| <figure class="image is-4by3"> | |
| <img src="{{ asset('images/document.png') }}" alt="Audio image" id="audio_image"> | |
| </figure> | |
| <a class="button is-primary" href="" :href="'{{ asset('storage/' . Auth::user()->name . '_' . Auth::id()) }}' + '/' + file.type + '/' + file.name + '.' + file.extension" target="_blank"> | |
| <i class="fa fa-download" aria-hidden="true"></i> | |
| Download | |
| </a> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div v-if="file.type == 'video'" class="video_block"> | |
| <video controls> | |
| <source src="" :src="'{{ asset('storage/' . Auth::user()->name . '_' . Auth::id()) }}' + '/' + file.type + '/' + file.name + '.' + file.extension" :type="'video/' + file.extension"> | |
| Your browser does not support the video tag. | |
| </video> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div v-if="file.type == 'audio'"> | |
| <figure class="image is-4by3"> | |
| <img src="{{ asset('images/music.png') }}" alt="Audio image" id="audio_image"> | |
| </figure> | |
| <audio controls> | |
| <source src="" :src="'{{ asset('storage/' . Auth::user()->name . '_' . Auth::id()) }}' + '/' + file.type + '/' + file.name + '.' + file.extension" :type="'audio/' + file.extension"> | |
| Your browser does not support the audio tag. | |
| </audio> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <figure class="image is-4by3" v-if="file.type == 'image'" @click="showModal(file)"> | |
| <img src="" :src="'{{ asset('storage/' . Auth::user()->name . '_' . Auth::id()) }}' + '/' + file.type + '/' + file.name + '.' + file.extension" :alt="file.name"> | |
| </figure> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="card-content"> | |
| <div class="content"> | |
| <p v-if="file !== editingFile" @dblclick="editFile(file)" :title="'Double click for editing filename'"> | |
| @{{ file.name + '.' + file.extension}} | |
| </p> | |
| <input class="input" v-if="file === editingFile" v-autofocus @keyup.enter="endEditing(file)" @blur="endEditing(file)" type="text" :placeholder="file.name" v-model="file.name"> | |
| <time datetime="2016-1-1">@{{ file.created_at }}</time> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (Storage::disk('local')->exists('/public/' . $this->getUserDir() . '/' . $file->type . '/' . $file->name . '.' . $file->extension)) { | |
| if (Storage::disk('local')->delete('/public/' . $this->getUserDir() . '/' . $file->type . '/' . $file->name . '.' . $file->extension)) { | |
| return response()->json($file->delete()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (Storage::disk('local')->exists($old_filename)) { | |
| if (Storage::disk('local')->move($old_filename, $new_filename)) { | |
| $file->name = $request['name']; | |
| return response()->json($file->save()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (Storage::putFileAs('/public/' . $this->getUserDir() . '/' . $type . '/', $file, $request['name'] . '.' . $ext)) { | |
| return $model::create([ | |
| 'name' => $request['name'], | |
| 'type' => $type, | |
| 'extension' => $ext, | |
| 'user_id' => Auth::id() | |
| ]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $this->validate($request, [ | |
| 'name' => 'required|unique:files', | |
| 'file' => 'required|file|mimes:' . $all_ext . '|max:' . $max_size | |
| ]); |