<?php

namespace App\Http\Controllers;

use App\Events\PicEtiquetas;
use App\Models\Fileira;
use App\Models\PicModel;
use Doctrine\DBAL\Events;
use Illuminate\Http\Request;

class PicetiquetaController extends Controller
{
    public function index(){

    }
    public function armazenar(Request $request){

        PicModel::create($request->all());
        $pic = new PicModel();
        $pic->barcode=$request->barcode;
        $pic->save();
        event(new PicEtiquetas($request->barcode));

        return $request->barcode;
    }
    public function mostrar(){
        $pic = PicModel::all();
        return json_encode($pic);
    }
    public function mostrar2(){
        $pic = Fileira::all();
        return  $pic;
    }
}
