Laravel Tip - Make Column Unique With Soft Delete

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • In this video, we will be looking at a very useful laravel tip where we will learn how to make a column unique along with with soft delete.
    === Support ===
    If you want me to continue making this kind of video for free on UA-cam, then you can help me financially by sending a few bucks to my Wise (bit.ly/3dnBRmX) account in Nepalese 🇳🇵 currency.
    My Wise email: ashish.dhamala2015@gmail.com
    === Social Media Links ===
    Let's be friends
    / aashish_dhamala
    === Video Related Links ===
    GitHub link
    github.com/Lar...
    Ecommerce Project - Playlist
    • E-Commerce
    === Other Videos ===
    What's New In Laravel 9
    • Laravel 9 Is Released ...
    New In Laravel Playlist
    • New In Laravel
    Laravel Package Development Playlist
    • Laravel Package Develo...
    Password Validation In Laravel with at least one Letters, Numbers, Upper and Lowercase or Symbols:
    • Password Validation In...
    Multiple Apis With ForwardsCalls Trait And Code Refactoring Tip - Laravel Hidden Feature:
    • Multiple Apis With For...
    Laravel Chunking - You Might Be Doing This Wrong - Problem and Solution:
    • Laravel Chunking - You...
    Laravel Tip - Properly Get Data Between Two Dates
    • Laravel Tip - Properly...
    Get Data From Multiple Databases In One Project | Laravel Tip
    • Get Data From Multiple...
    === Theme and Font Used ===
    Theme:
    Cobalt2 Theme Official (marketplace.vi...)
    Font:
    JetBrains Mono (www.jetbrains....)
    === Tech stack ===
    Laravel
    PHP
    #laravel #php #laraveltip #laratips

КОМЕНТАРІ • 40

  • @DRMOHAMEDKHDR
    @DRMOHAMEDKHDR Рік тому

    Very Helpful , Thanks laratips

  • @rajansahani225
    @rajansahani225 Рік тому

    Lots of thanks ❤

  • @hassamulhaq7762
    @hassamulhaq7762 2 роки тому

    helpful, i also followed that person because of cool stuff on sql. and really thanks to you to demonstrate it 🖤

  • @ShibbirAhmedRaihan
    @ShibbirAhmedRaihan 2 роки тому +1

    very helpful tips like always

    • @Laratips
      @Laratips  2 роки тому

      Glad to hear that!

  • @chlouis-girardot
    @chlouis-girardot 2 роки тому

    Awesome ! Thanks for sharing this 🙏

  • @JigarDhulla
    @JigarDhulla 2 роки тому

    Keep up the good work. Thanks!

  • @RanjeetYadav-oj9mv
    @RanjeetYadav-oj9mv Рік тому

    Thanks

  • @jderdmann1
    @jderdmann1 2 роки тому

    This is great!

  • @Ehsankhan0577
    @Ehsankhan0577 2 роки тому

    it was outside the stadium..thank you

  • @ricko13
    @ricko13 Рік тому +1

    Looks cool, but too complicated, and what if in the future you find some bugs related to this implementation and you forgot about it 😬 what would you do?

    • @Laratips
      @Laratips  Рік тому

      In my view soft deletes are prone to bugs. You can always forget to exclude the soft deleted data if you are not using the model when building the query. This has happened to me previously 😅.

  • @ikay8179
    @ikay8179 2 роки тому

    Hello. Thank you very much for this wonderful video. What database management system do you use? that's really cool

    • @altairmendoza3679
      @altairmendoza3679 2 роки тому +1

      i believe it's called DBeaver

    • @Laratips
      @Laratips  2 роки тому

      Yes, It's DBeaver. It is cross-platform open-source app.

  • @amiraghyan99
    @amiraghyan99 Рік тому

    Hello.
    What will happen if reset deleted user and try to login ?
    Which emile will use if both users have some email and password ?

    • @Laratips
      @Laratips  Рік тому

      The attempt method will get the first user from the database. You need to make sure it picks the correct user.

  • @asifulislam5275
    @asifulislam5275 2 роки тому

    If i restore 1st id then match 1st id email and 11th id email are same.

    • @Laratips
      @Laratips  2 роки тому

      Yes, you are right. If we are using soft delete, then we have to check it ourself in the application. You can say it as one of the disadvantages.

  • @IndraPrastha
    @IndraPrastha 2 роки тому

    what is the IDE used for running php script shown in the video?

  • @CeresOutpost
    @CeresOutpost Рік тому

    The question is, why doesn't Laravel validation take soft deletes into consideration when most people are using soft deletes in their apps?

    • @Laratips
      @Laratips  Рік тому

      I have seen many projects and it's actually opposite. Most of them were not using soft deletes. Seems like personal preference, that's why Laravel might not have made it default.

  • @ahmedjaber8595
    @ahmedjaber8595 2 роки тому

    I want to know how to add 1 button in trash to clear all table
    Any idea ?

    • @ahmedjaber8595
      @ahmedjaber8595 2 роки тому

      I search a lot in google and many blogs

    • @Laratips
      @Laratips  2 роки тому

      Do you mean all table or all data of one table?

    • @ahmedjaber8595
      @ahmedjaber8595 2 роки тому

      @@Laratips just the table that contains soft deleted products (trash) button to clear that with 1 click
      I tryed it with datatable

    • @ahmedjaber8595
      @ahmedjaber8595 2 роки тому

      @@Laratips any solution without datatable ?

    • @Laratips
      @Laratips  2 роки тому

      You can do this when a button is clicked:
      User::trashed()->delete();

  • @mevadakalpesh3529
    @mevadakalpesh3529 2 роки тому

    Give your vs code extensions list .. please sir

    • @Laratips
      @Laratips  2 роки тому +2

      These are the extensions I use:
      Error Lens
      File Utils
      Git History
      GitLens - Git supercharted
      Headwind
      Import Cost
      Laravel Blade formatter
      Laravel Blade Snippets
      Laravel Blade Spacer
      Laravel Blade Wrapper
      Laravel Docs
      Laravel Extra Intellisense
      Laravel goto view
      Laravel Pint
      Laravel-goto-components
      Laravel-goto-controller
      PHP class generator
      PHP constructor
      PHP Intelephense
      PHP Namespace Resolver
      phpfmt - php formatter
      PHPUnit
      Tailwind CSS IntelliSense
      Tailwind Docs
      Turbo Console Log
      UUID Generator
      vscode-icons
      Volar
      Vue peek
      vuetify-vscode

    • @mevadakalpesh3529
      @mevadakalpesh3529 2 роки тому +1

      @@Laratips thanks you sir