28 File Upload - Laravel 11 tutorial for beginners.

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

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

  • @tonyxhepaofficial
    @tonyxhepaofficial  7 месяцев назад +2

    28 File Upload - Laravel 11 tutorial for beginners.

  • @ly2ly2ly13
    @ly2ly2ly13 17 дней назад

    thanks alot man

  • @MarcelloPato
    @MarcelloPato Месяц назад

    Great work Tony! Can you tell us which font is this that you are using?

  • @juniorgeba25
    @juniorgeba25 7 месяцев назад

    It would be interesting to show the management of multiple doc and pdf files

  • @sidymohamedcherifhaidara980
    @sidymohamedcherifhaidara980 2 месяца назад +1

    How uploaded file laravel with nuxt3

  • @chiqui1234ok
    @chiqui1234ok 4 месяца назад

    hi! what pluggin do you have for those snippets/help when you write laravel code?

  • @omidatash.peykar1139
    @omidatash.peykar1139 6 месяцев назад +2

    You did not say how to display the same uploaded file

    • @radoslavrac8619
      @radoslavrac8619 5 месяцев назад +1

      After successful image upload you can see your image in storage/app/public/[and_your_file_for_images], now you have to link app/public with just public file cuz image is uploaded to app/public but users can access only public file, not app/public. With this command: php artisan storage:link you will link this two files and now users can access images in app/public through just public file. After this step you have to display your image in blade, add this code: {{url('storage/'.$your_variable)}}
      Hope this helps 🤞

  • @TyoussefPureLander
    @TyoussefPureLander 17 дней назад

    Please use normal font

  • @rafablum
    @rafablum 6 месяцев назад

    Hi Tony
    Through this tutorial I had some problems, as the image was not being deleted, the way I added the image in a non-public place and to show the image in the view, so here's how I improved it, in case anyone has the same problem.
    In view:
    in Controller Post
    update:
    $validate = $request->validate([
    'title' => ['required', 'min:3', 'max:255'],
    'content' => ['required', 'min:10', 'max:255'],
    'thumbnail' => ['nullable', 'image', 'mimes:jpg,png,jpeg,gif', 'max:2048']
    ]);
    if ($request->hasFile('thumbnail')) {
    if (Storage::exists($post->thumbnail)) {
    Storage::delete($post->thumbnail);
    }
    $validate['thumbnail'] = $request->file('thumbnail')->store('public/thumbnails');
    }
    $post->update($validate);
    store:
    $validate = $request->validate([
    'title' => ['required', 'min:3', 'max:255'],
    'content' => ['required', 'min:10', 'max:255'],
    'thumbnail' => ['nullable', 'image', 'mimes:jpg,png,jpeg,gif', 'max:2048']
    ]);
    $validate['thumbnail'] = $request->file('thumbnail')->store('public/thumbnails');
    auth()->user()->posts()->create($validate);
    delete:
    Storage::delete($post->thumbnail);
    $post->delete();