Image Uploads with Laravel

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 53

  • @MrPkmonster
    @MrPkmonster 7 лет назад

    For people using Laravel 5.4, adding {{ csrf_field() }} inside tag

  • @donnise2509
    @donnise2509 8 лет назад +5

    Hi Great Video!
    I want to ask if how can I store the images in my database? Thanks a lot! :)

  • @tysweezy
    @tysweezy 9 лет назад

    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. :)

  • @Moatazaitoun
    @Moatazaitoun 8 лет назад +2

    @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?

  • @ehguacho2008
    @ehguacho2008 6 лет назад

    surely an aside comment, but gotta say it: i loved your terminal's color scheme ^^

  • @ververvanhier
    @ververvanhier 8 лет назад +9

    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 ;)

  • @soubarnobanerjee8257
    @soubarnobanerjee8257 6 лет назад

    Thank you so much sir. My respect for you is 100% for being a fantastic teacher. :D

  • @DuongNguyen-je3zb
    @DuongNguyen-je3zb 8 лет назад

    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?

  • @bobbylight4205
    @bobbylight4205 9 лет назад

    How did you change the appearance of the terminal? Great video btw.

    • @Devdojo
      @Devdojo  9 лет назад

      +Kevin Manapparambil +Jeramee Flemming I'm using solarized dark: ethanschoonover.com/solarized theme. Hope that helps :)

    • @bobbylight4205
      @bobbylight4205 9 лет назад

      devdojo Thanks! I'll be sure to give this a try.

  • @vinayaksaxena7167
    @vinayaksaxena7167 8 лет назад

    Nice Work Sir

  • @DznKux
    @DznKux 8 лет назад

    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 ?

  • @jenpatrickcn
    @jenpatrickcn 7 лет назад

    @devdojo, can you make a tutorial for image gallery?

  • @filipmihal1851
    @filipmihal1851 8 лет назад +1

    Hi, can you help me, how to compress image on client site, because uploading on my site takes very long time. Thanks ;)

  • @nabaus6170
    @nabaus6170 8 лет назад

    great simple video
    thanks a bunch

  • @saurav1502
    @saurav1502 7 лет назад

    can u show the download process like how to download the uploaded files

  • @butcherfirewaters
    @butcherfirewaters 4 года назад

    Hi ! How I can uploade Gallery of images?

  • @RamKumar-uh5gw
    @RamKumar-uh5gw 9 лет назад

    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

    • @Devdojo
      @Devdojo  9 лет назад +2

      +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.

    • @rajapurva2012
      @rajapurva2012 9 лет назад

      +devdojo Still waiting !

  • @fikri.abdoul
    @fikri.abdoul 8 лет назад

    Great video, helps me alot

  • @video88548
    @video88548 8 лет назад

    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

  • @vishwas62
    @vishwas62 8 лет назад

    nice work , keep it up sir :)

  • @srijanaaryal7767
    @srijanaaryal7767 6 лет назад

    Thank you soo much it really works....

  • @yassinmakni5630
    @yassinmakni5630 6 лет назад

    how did you generate the html code with form_upload ?

  • @srilalitha6423
    @srilalitha6423 8 лет назад

    Hi, 'Input::hasFile('file')' returns null value. Anything echoed in this condition is not displayed. can you help me

  • @IvensPontes
    @IvensPontes 7 лет назад

    I can make an validation and don't use if has?

  • @josetutiven8835
    @josetutiven8835 9 лет назад

    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?

    • @Devdojo
      @Devdojo  9 лет назад

      +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.

  • @johnspotifi2526
    @johnspotifi2526 8 лет назад +1

    Hey mate, is the intervention image package vid already available? :)

    • @Devdojo
      @Devdojo  8 лет назад +1

      +john spotifi Not yet, we'll be sure to get it out soon since Laravel 5.2 just got released. Thanks :)

  • @KT-ut9zg
    @KT-ut9zg 7 лет назад

    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

    • @KT-ut9zg
      @KT-ut9zg 7 лет назад

      Oh my ZSH - gottit!

  • @AtomCoder
    @AtomCoder 7 лет назад

    What mac terminal are you using ?

  • @Nhung66
    @Nhung66 9 лет назад

    This is for laravel 5? can you please do this in laravel 5.1 please. Thanks :)

    • @Devdojo
      @Devdojo  9 лет назад

      +Nhung Nguyen Sure thing, we'll be creating another one specifically for 5.2 when it is available :)
      Thanks for the comment. TTYS

  • @SudhirKumar-ov6ee
    @SudhirKumar-ov6ee 6 лет назад +1

    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

    • @ALEXEIS
      @ALEXEIS 6 лет назад

      I can do that, but I don't make tutorial videos.

  • @tharochhith1173
    @tharochhith1173 8 лет назад

    why it said can't find class input

  • @salaheddinerakibe5760
    @salaheddinerakibe5760 7 лет назад

    Thanks a lot

  • @abdussalama.h.f6163
    @abdussalama.h.f6163 6 лет назад

    Thank You

  • @bulldog2024
    @bulldog2024 6 лет назад

    What if I want to store images in a database instead of a folder?

    • @ALEXEIS
      @ALEXEIS 6 лет назад

      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.

  • @the_tech_titan_2.0
    @the_tech_titan_2.0 6 лет назад

    what is the method for laravel 5.5

    • @ALEXEIS
      @ALEXEIS 6 лет назад

      A lot has changed

  • @ronnyereandrade4362
    @ronnyereandrade4362 7 лет назад

    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*/

  • @heyyy4987
    @heyyy4987 9 лет назад

    amazing.:)

  • @calebpacheco
    @calebpacheco 8 лет назад

    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 !

  • @adamkurniawan3048
    @adamkurniawan3048 8 лет назад

    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?

  • @nasirtabassum8924
    @nasirtabassum8924 7 лет назад

    pic not save in db this is not good way