guirisan / app

0 stars 0 forks source link

[laravel-model] creation of a model #11

Open guirisan opened 7 years ago

guirisan commented 7 years ago
        $plaga = Plaga::create([
            'user_id' => Auth::id(),
            'nom' => request('nom'),
            'nom_cientific' => request('nom_cientific'),
            'descripcio' => request('descripcio'),
            'tractament' => request('tractament'),
        ]);

Per a poder especificar el valor de cada camp.

Usar Auth::id() o auth()->user()->id ????? See #12

Fer en els formularis de: