Laravel 8 - advanced CRUD (Livewire and Tailwind)

By DEV Community - 2021-01-01

Description

We will continue previous Laravel 8 - CRUD basic steps (Livewire and Tailwind) tutorial. But this ti... Tagged with laravel, livewire, crud, tailwind.

Summary

  • Let's add more fields in companies table.
  • We want to add extra fields for information about which user created or updated company.
  • phpnamespaceApp\Models;useIlluminate\Database\Eloquent\Factories\HasFactory;useIlluminate\Database\Eloquent\Model;useIlluminate\Support\Facades\Auth;classCompanyextendsModel{useHasFactory;protected$fillable=['title','created_by','updated_by'];/** * This is model Observer which helps to do the same actions automatically when you creating or updating models * * @var array */protectedstaticfunctionboot(){parent::boot();static::creating(function($model){$model->created_by=Auth::id();$model->updated_by=Auth::id();});static::updating(function($model){$model->updated_by=Auth::id();});}} If we are thinking to use this modal in other places, need to create standard modal style (frame), which we can use with different content.

 

Topics

  1. UX (0.35)
  2. Coding (0.19)
  3. Frontend (0.07)

Similar Articles

How to Add Preloader to Image in Flutter

By DEV Community - 2020-12-27

Flutter is a cross-platform mobile application development framework that offers a widget-based mecha... Tagged with flutter, webdev, codenewbie.

How to Build a Python GUI Application With wxPython

By realpython - 2020-12-14

In this step-by-step tutorial, you'll learn how to create a cross-platform graphical user interface (GUI) using Python and the wxPython toolkit. A graphical user interface is an application that has b ...