/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request) { $input = $request->all(); $pizza = Pizza::create($input); $pizza->ingredients()->attach($input['ingredients']); return redirect('pizzas'); }
/** * Run the database seeds. * * @return void */ public function run() { Pizza::create(['ime' => 'Capriciossa']); Pizza::create(['ime' => 'Venezia']); Pizza::create(['ime' => 'Margarita']); }