app/Http/Controllers/PacketController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function scanner(Request $request)
    {
        $validator = \Illuminate\Support\Facades\Validator::make($request->all(), [
            'name' => 'required|max:255',
        ]);
        if ($validator->fails()) {
            return redirect('/')
                ->withInput()
                ->withErrors($validator);
        }
        $packet = new Packet();
        $insertedPacket=$packet->insertPacket($request->name);
        return redirect('/')->withErrors($insertedPacket);
    }
public function scanner ( Request $ request ) { $ validator = \ Illuminate \ Support \ Facades \ Validator :: make ( $ request -> all ( ) , [ 'name' => 'required|max:255' , ] ) ; if ( $ validator -> fails ( ) ) { return redirect ( '/' ) -> withInput ( ) -> withErrors ( $ validator ) ; } $ packet = new Packet ( ) ; $ insertedPacket = $ packet -> insertPacket ( $ request -> name ) ; return redirect ( '/' ) -> withErrors ( $ insertedPacket ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .