This file contains 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
<template> | |
<div> | |
<el-upload | |
class="upload-demo" | |
action="/api/upload/" | |
name="file[]" | |
:on-success="handleSuccess" | |
:on-remove="handleRemove" | |
:before-remove="beforeRemove" | |
multiple | |
:limit="3" | |
:on-exceed="handleExceed" | |
:file-list="fileList"> | |
<el-button size="small" type="primary">Click to upload</el-button> | |
<div slot="tip" class="el-upload__tip">jpg/png files with a size less than 500kb</div> | |
</el-upload> | |
</div> | |
</template> | |
<script> | |
export default{ | |
data() { | |
return { | |
fileList: [] | |
}; | |
}, | |
methods: { | |
handleRemove(file, fileList) { | |
let vm = this | |
axios.delete('/api/upload/' + file.uid) | |
.then(function () { | |
let index = _.findIndex(vm.fileList, ['uid', file.uid]) | |
vm.$delete(vm.fileList, index) | |
}) | |
.catch(function (error) { | |
console.log(error); | |
}); | |
}, | |
handleSuccess(response, file, fileList) { | |
var vm = this | |
_.map(response, function (data) { | |
file['uid'] = data | |
}) | |
vm.fileList = fileList; | |
}, | |
handleExceed(files, fileList) { | |
this.$message.warning(`The limit is 3, you selected ${files.length} files this time, add up to ${files.length + fileList.length} totally`); | |
}, | |
beforeRemove(file, fileList) { | |
return this.$confirm(`do you really want to delete ${ file.name }?`); | |
} | |
} | |
} | |
</script> |
This file contains 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
/** | |
* Store a newly created resource in storage. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @return \Illuminate\Http\Response | |
*/ | |
public function store(Request $request) | |
{ | |
$uploadId = array(); | |
if ( $files = $request->file('file')) { | |
foreach ($request->file('file') as $key => $file) { | |
$name = time() . $key . $file->getClientOriginalName(); | |
$filename = $file->move('files', $name); | |
$uploadId[] = Upload::create([ | |
'file' => $name])->id; | |
} | |
} | |
return response()->json($uploadId, 200); | |
} |
This file contains 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
/** | |
* Remove the specified resource from storage. | |
* | |
* @param \App\Upload $upload | |
* @return \Illuminate\Http\Response | |
*/ | |
public function destroy(Upload $upload) | |
{ | |
if (!(empty($upload->file))) { | |
if (file_exists(public_path() . '/files/' . $upload->file)) { | |
unlink(public_path() . '/files/' . $upload->file); | |
} | |
Upload::where('id', $upload->id)->delete(); | |
} | |
return response()->json(null, 204); | |
} |
229 Comments
Imagine that your vehicle was taken! When you approach the police, they inquire about a specific "VIN decoder"
A VIN decoder is what?
Similar to a passport, the "VIN decoder" allows you to find out the date of the car's birth and the identity of its "parent" (manufacturing facility). You can also find out:
1.Type of engine
2.Model of a vehicle
3.The DMV's limitations
4.Number of drivers in this vehicle
The location of the car will be visible to you, and keeping in mind the code ensures your safety. The code can be examined in the online database. The VIN is situated on various parts of the car to make it harder for thieves to steal, such as the first person sitting on the floor, the frame (often in trucks and SUVs), the spar, and other areas.
What happens if the VIN is intentionally harmed?
There are numerous circumstances that can result in VIN damage, but failing to have one will have unpleasant repercussions because it is illegal to intentionally harm a VIN in order to avoid going to jail or calling the police. You could receive a fine of up to 80,000 rubles or spend two years in prison. You might be stopped by an instructor on the road.
Conclusion.
The VIN decoder may help to save your car from theft. But where can you check the car reality? This is why we exist– VIN decoders!