Skip to main content

Code Examples of JuanDMeGon/Laravel-from-Scratch

Discover how to use Laravel's JuanDMeGon/Laravel-from-Scratch examples.

9 examples

Custom artisan commands

Files in this example

  • app/Console/Commands/RemoveOldCarts.php
View all examples

Service classes

Files in this example

  • app/Services/CartService.php
    • app/Http/Controllers/CartController.php
View all examples

Global scopes

Files in this example

  • app/Scopes/AvailableScope.php
    • app/Product.php
View all examples

Accessors

Files in this example

  • app/Product.php
    • resources/views/components/product-card.blade.php
View all examples

Polymorphic relationships

Files in this example

  • app/Cart.php
    • app/Product.php
      • app/Http/Controllers/OrderController.php
View all examples

Collection Methods: MapWithKeys

Files in this example

  • app/Http/Controllers/OrderController.php
View all examples

Database transactions

Files in this example

  • app/Http/Controllers/OrderController.php
View all examples