Laravel

New

Ich habe mir ein CLI Tool programmiert, das ein neues Laravel Projekt einrichtet, damit ich direkt starten kann.

butler laravel:new name

Artikel

Blogs

Tighten

Packages

Livewire

Valet

  • Wenn es nicht geht:

brew upgrade
valet install

Traits

public function initializeTRAITNAME

namespace App\Traits;

trait Unguarded
{
    public static function bootUnguarded()
    {
        static::creating(function ($model) {
            // 
        });
    }

    public function initializeUnguarded()
    {
        self::$unguarded = true;
        $this->guarded = [];
    }
}

Attributes

Routes

Batch

  • BatchController

    • POST: index_route/batch

    • PUT: index_route/batch

    • DELTE: index_route/batch

NULL Object Pattern

Relationships

    public function relationship() : HasOne
    {
        return $this->hasOne(Relationship::class)->withDefault([
            'foo' => 'bar',
        ]); 
    }

Last updated