app/Http/Controllers/Staff/SigningController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $validatedData = $request->validate([
            'nombre' => 'required|string|max:255|regex:/^[A-ZÑ ]+$/',
            'primerApellido' => 'required|string|max:255|regex:/^[A-ZÑ ]+$/',
            'segundoApellido' => 'required|string|max:255|regex:/^[A-ZÑ ]+$/',
            'curp' => 'required|string|max:20|regex:/^[A-ZÑ0-9 ]+$/|unique:firmas',
            'abrTitulo' => 'required|string|max:20|regex:/^[A-zÑñ. ]+$/'
        ]);
        $action = 'Firma::create';
        $table  = 'firmas';
        if ( $save = Firma::create($request->all()) )
             if ( $this->history($save, $action, $table) )
                $response = 200;
            else    
                $response = 303; 
        else    
            $response = 302;
    return redirect()->route('signing.index')->with('code', $response);
    }
public function store ( Request $ request ) { $ validatedData = $ request -> validate ( [ 'nombre' => 'required|string|max:255|regex:/^[A-ZÑ ]+$/', 'primerApellido' => 'required|string|max:255|regex:/^[A-ZÑ ]+$/', 'segundoApellido' => 'required|string|max:255|regex:/^[A-ZÑ ]+$/', 'curp' => 'required|string|max:20|regex:/^[A-ZÑ0-9 ]+$/|unique:firmas', 'abrTitulo' => 'required|string|max:20|regex:/^[A-zÑñ. ]+$/' ] ) ; $ action = 'Firma::create' ; $ table = 'firmas' ; if ( $ save = Firma :: create ( $ request -> all ( ) ) ) if ( $ this -> history ( $ save , $ action , $ table ) ) $ response = 200 ; else $ response = 303 ; else $ response = 302 ; return redirect ( ) -> route ( 'signing.index' ) -> with ( 'code' , $ response ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//