For the CSRF token, I believe you can also add {!! csrf_field() !!} within the form in your blade file. That will load the hidden input field. :) Awesome job on this video. :)
@devdojo Man, That was super easy. Thank you. But the questation is: Why when I used "use \Input as Input" as you told It didn't work. But When I replaced this statement with "use Illuminate\Support\Facades\Input;" It worked just fine?
this is a cool experience .. but what next ?? i mean what about storing image url into database so when a user login once again then they can get there profile picture .. please provide the video
hi, i have made it to the final stage and this error appears. FatalErrorException in UploadController.php line 5: syntax error, unexpected 'class' (T_CLASS), expecting ',' or ';' where my mistake? thanks
looks nice, but I was looking for a way to upload an image to the mysql database without moving the file but actually uploading the binary content of the file as a blob, that is fairly easy with simple php but I can't seem to find a way to do it with laravel, do you know if there is a way to do that?
+Jose Tutiven Sure, you could totally do this. Here is an article that explains how to store them in a database: stackoverflow.com/questions/1636877/how-can-i-store-and-retrieve-images-from-a-mysql-database-using-php Hope that helps. Thanks.
hello, i want you to make a video on a project assign below so that we all your viewers got benefited, plz do it Please create three pages in LARAVEL. Task list: 1) Create page to add news. Fields are news title, description and news picture. - Validate below fields: - news title (required) 2) On page submit, redirect news to 'Success' page and display entered news's title on screen. 3) Create another page where all news will be listed with news title and uploaded pic in list view. If news click on news name then it will redirect to news detail page where you need to display all news's data. Note: 1) Page should have common header with logo and menu with link to add news and view news list. 2) All data should be stored in database. 3) For validation, use Laravel inbuild validation functionality
A database can't store files. Only texts. You will need to save the name of the image i.e "butterfly.jpg" on the image field/column on the database. Then yo can access them on the view i.e {{ asset('storage/uploads/'.$model->image) }} The image itself will still be stored on your disk or use a third party cloud-host like Amazon to store your images. You can also use regular hosts i.e shared hosts or VPS to host your entire app. You just need to buy enough space if your site will have lots of files.
Boa noite galera muito bom o tutorial mais estou usando o intervention image é esta tudo funcionando, minha duvida e que gostaria de retirar as fotos salvas da pasta public para não ser acessada pela URL alguém saberia como fazer ? Esse e o meu Codigo :: public function update_avatar(Request $request){ // Controle do upload do usuário do avatar if($request->hasFile('avatar')){ $avatar = $request->file('avatar'); $filename = time() . '.' . $avatar->getClientOriginalExtension(); Image::make($avatar)->resize(300, 300)->save( public_path('/uploads/avatars/' . $filename ) ); $user = Auth::user(); $user->avatar = $filename; $user->save(); } return view('profile', array('user' => Auth::user()) ); }/*fim da function para fazer upload de imagens*/
Hey Great video devmojo! How to generate a random name for my images ? public function upload () { if(Input::hasFile('file')){ $file = Input::file('file'); $file->move('uploads', $file->getClientOriginalName()); echo 'Uploaded'; } } *Beginner in programming !
Hi, could we resize it? I think we need install intervention/image if we want to resize our image after uploading? Or does have another way to do that without it?
For people using Laravel 5.4, adding {{ csrf_field() }} inside tag
Hi Great Video!
I want to ask if how can I store the images in my database? Thanks a lot! :)
For the CSRF token, I believe you can also add {!! csrf_field() !!} within the form in your blade file. That will load the hidden input field. :) Awesome job on this video. :)
@devdojo Man, That was super easy. Thank you. But the questation is: Why when I used "use \Input as Input" as you told It didn't work. But When I replaced this statement with "use Illuminate\Support\Facades\Input;" It worked just fine?
surely an aside comment, but gotta say it: i loved your terminal's color scheme ^^
Hey Great video devmojo!
For people using laravel 5 just replace use \Input as Input; with use Illuminate\Support\Facades\Input; in it will work ;)
Thank you Sir !
Still people like you exists :)
Thank you!
Thank you so much sir. My respect for you is 100% for being a fantastic teacher. :D
Hi! Thanks for great tutorial. But I can not find your tutorial video about intervention anywhere. Can you please tell me where to find your video?
How did you change the appearance of the terminal? Great video btw.
+Kevin Manapparambil +Jeramee Flemming I'm using solarized dark: ethanschoonover.com/solarized theme. Hope that helps :)
devdojo Thanks! I'll be sure to give this a try.
Nice Work Sir
Great Video! However, I got 'Fatal error: Class 'Input' not found'. I am not sure where the problem is. Could you please tell me how to fix this ?
@devdojo, can you make a tutorial for image gallery?
Hi, can you help me, how to compress image on client site, because uploading on my site takes very long time. Thanks ;)
great simple video
thanks a bunch
can u show the download process like how to download the uploaded files
Hi ! How I can uploade Gallery of images?
this is a cool experience .. but what next ?? i mean what about storing image url into database so when a user login once again then they can get there profile picture .. please provide the video
+Ram Kumar Hey Ram, absolutely. We'll be posting more videos soon that can show you more after uploading the image :) Thanks for the comment.
+devdojo Still waiting !
Great video, helps me alot
hi, i have made it to the final stage and this error appears.
FatalErrorException in UploadController.php line 5:
syntax error, unexpected 'class' (T_CLASS), expecting ',' or ';'
where my mistake? thanks
nice work , keep it up sir :)
Thank you soo much it really works....
how did you generate the html code with form_upload ?
Hi, 'Input::hasFile('file')' returns null value. Anything echoed in this condition is not displayed. can you help me
I can make an validation and don't use if has?
looks nice, but I was looking for a way to upload an image to the mysql database without moving the file but actually uploading the binary content of the file as a blob, that is fairly easy with simple php but I can't seem to find a way to do it with laravel, do you know if there is a way to do that?
+Jose Tutiven Sure, you could totally do this. Here is an article that explains how to store them in a database: stackoverflow.com/questions/1636877/how-can-i-store-and-retrieve-images-from-a-mysql-database-using-php Hope that helps. Thanks.
Hey mate, is the intervention image package vid already available? :)
+john spotifi Not yet, we'll be sure to get it out soon since Laravel 5.2 just got released. Thanks :)
Off topic, but what is the terminal program you're using? Went hunting for something online but couldn't find anything that looked as nice as that
Oh my ZSH - gottit!
What mac terminal are you using ?
This is for laravel 5? can you please do this in laravel 5.1 please. Thanks :)
+Nhung Nguyen Sure thing, we'll be creating another one specifically for 5.2 when it is available :)
Thanks for the comment. TTYS
hello, i want you to make a video on a project assign below so that we all your viewers got benefited, plz do it
Please create three pages in LARAVEL.
Task list:
1) Create page to add news. Fields are news title, description and news picture.
- Validate below fields:
- news title (required)
2) On page submit, redirect news to 'Success' page and display entered news's title on screen.
3) Create another page where all news will be listed with news title and uploaded pic in list view. If news click on news name then it will redirect to news detail page where you need to display all news's data.
Note:
1) Page should have common header with logo and menu with link to add news and view news list.
2) All data should be stored in database.
3) For validation, use Laravel inbuild validation functionality
I can do that, but I don't make tutorial videos.
why it said can't find class input
Thanks a lot
Thank You
What if I want to store images in a database instead of a folder?
A database can't store files. Only texts.
You will need to save the name of the image i.e "butterfly.jpg" on the image field/column on the database. Then yo can access them on the view i.e {{ asset('storage/uploads/'.$model->image) }}
The image itself will still be stored on your disk or use a third party cloud-host like Amazon to store your images.
You can also use regular hosts i.e shared hosts or VPS to host your entire app. You just need to buy enough space if your site will have lots of files.
what is the method for laravel 5.5
A lot has changed
Boa noite galera muito bom o tutorial mais estou usando o intervention image é esta tudo funcionando, minha duvida e que gostaria de retirar as fotos salvas da pasta public para não ser acessada pela URL alguém saberia como fazer ? Esse e o meu Codigo ::
public function update_avatar(Request $request){
// Controle do upload do usuário do avatar
if($request->hasFile('avatar')){
$avatar = $request->file('avatar');
$filename = time() . '.' . $avatar->getClientOriginalExtension();
Image::make($avatar)->resize(300, 300)->save( public_path('/uploads/avatars/' . $filename ) );
$user = Auth::user();
$user->avatar = $filename;
$user->save();
}
return view('profile', array('user' => Auth::user()) );
}/*fim da function para fazer upload de imagens*/
amazing.:)
Hey Great video devmojo!
How to generate a random name for my images ?
public function upload () {
if(Input::hasFile('file')){
$file = Input::file('file');
$file->move('uploads', $file->getClientOriginalName());
echo 'Uploaded';
}
}
*Beginner in programming !
Hi, could we resize it? I think we need install intervention/image if we want to resize our image after uploading? Or does have another way to do that without it?
pic not save in db this is not good way