Комментарии:
"??=" What does that syntax mean? It's not Null coalescing
ОтветитьThank you for explain is easy way
ОтветитьThanks
ОтветитьI think your explanation way suite just the master developer
ОтветитьThank you.I just got a deep understanding of the disks.But I have a different method of having a class ie ImageProcessor which I use for all my image processing.
ОтветитьGreat tips as always! May I ask what app are you using to connect to the database? Thank you
ОтветитьWhat about Google drive??
ОтветитьExcellent explanation.Spartie media library solves many problems as you mentioned.
ОтветитьThanks so helpful video. Thanks
ОтветитьWhy you save in the variable $avatar the action Storage::disk.... Why you dont simple do Storage::disk... without saving in $avatar that is something that I saw also in real life projects but I never understand why
ОтветитьWhat ??= operator does?
ОтветитьI don't use file as an extra field in the db table, instead have a separate controller and model for cv, and avatar, that is an Avatar controller and a CV controller. I then use the post controller to handle both file inputs. I take the post ID after the post has been updated and save it
if ($file = $request->file('CVfile')) {
if (CVFilecontroller::where('post_id', '=', $request->post_id)) {
$jobfiler = JobOpslagFile::all()->where("post_id",$id);
foreach($jobfiles as $CVfile){
$filename = $CVfile->name;
$CVfile->delete();
$CVfile_path = public_path('ansfil/'.$filename);
if(file_exists($CVfile_path)){
unlink($CVfile_path);
}
}
}
$fileName = "CVfile".auth()->id() . '_' . time() . '.'. $request->CVfile->extension();
$type = $request->CVfile->getClientMimeType();
$size = $request->CVfile->getSize();
$request->CVfile->move(public_path('CVfile'), $fileName);
CVFilecontroller::create([
'user_id' => auth()->id(),
'post_id' => $id,
'name' => $fileName,
'type' => $type,
'size' => $size
]);
}
This is ressourceful
ОтветитьTerrific tutorial --- thanks! Why are the methods getClientOriginalName and getClientOriginalExtension "considered unsafe"? The Laravel docs says it's because "the file name and extension may be tampered with by a malicious user". What kind of "tampering" is possible and what could the effect of such tampering be? Is it unsafe even to get that information and store it in the database as a field (without using it as the name of the file)?
Ответитьi have last_login_at column in table users. how update this column when user logs in? event listener doesnt work...
ОтветитьThank you!
Please tell me how you can set up folders for the Spatie media library so that if there are a large number of files, they can be sorted into subfolders? and is it possible not to do a subscription for one file?
When trying to create a user page in which the posts can only be seen by the followers of the page and the owner themself, where should I store the posts images? If I store it in the public disk anyone that has gotten the image link once can access it forever. Is this a problem? For example what would a platform like instagram do for private pages and the images in those pages?
ОтветитьHi,
Awesoem tutorial as always.
I have a question, in the case of private file, you told the method to allow "Download" the file, what if we want to show the image (to only authorized users)?
awesome information as always. thanks 👍
ОтветитьPlease @LaravelDaily, can you help us create a video on Localisation. Am trying to build a Laravel Application of English and Arabic, many Laravel developers are having this issue also and also the use of rtl & ltr when chnaging from Arabic to English, can you help with this Sir?
For todays tutroial, i really do learn a lot, Thanks 👍
Thank you very much for your helpful videos, master. This is one of the treasures.
ОтветитьJust btw, the s3 filesystem does also support `root`, so you can do the same "make a new disk per thing to store" and use a single s3 bucket for public and a single buckeet for private
ОтветитьThanks for the video.
Those who don't have SSH access can create a route to generate symlink.
Route::get(
'symlink',
fn () => Artisan::call(
'storage:link'
)
);
will generate the link.
Hello sir,
How to upload a zip file which contains some xls files inside.
So basically upload zip file then extract it somewhere and start inserting all rows of each xls files into database.
Ho about file size configurations? For both the Laravel Application and the web server you are using.
ОтветитьSo we can use spatie/media-library for any file type? 🤔
Ответить❤
ОтветитьWhat about file visibility?
ОтветитьI don't really know how laravel handles caches
ОтветитьSir which cache driver should I use in Laravel? Please tell me sir.
ОтветитьYou rock!!!
How can we crop avatar image to store small and centered images?