0๐
You need to check files extension :
$extension = $file->extension();
$allowed_file_types = ['jpg','png','gif'];
if (in_array($extension, $allowed_file_types)){
//do upload
}else{
Continue;
}
for file sizes check this thread
0๐
You can use laravel image validation
$this->validate ($input, [
'files.*.image' => 'image|max:200',
]):
Note: max(size) is in Kilobytes
You can also use dimension rule
$this->validate ($input, [
'files.*.image' => 'dimensions:min_width=100,min_height=200'
]):
- [Vuejs]-Can't update record after creating record Vue.js/Vuetify/Axios
- [Vuejs]-Handle custom row click
0๐
You can set the following rule in your validation โ
'file' => 'required|max:100|mimes:jpg,png,bmp' // 100kb, mimes must have image extensions
- [Vuejs]-What can be the next step after running npm build in vue app to deploy it on server?
- [Vuejs]-How do you properly dispatch an action in vuex? Getting error [vuex] unknown action type in Chrome
Source:stackexchange.com