app/Http/Controllers/JobTypeController.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)
    {
        $this->validate($request,[
            'abbr' => 'required|max:50|unique:job_types,abbr',
            'name' => 'required|max:200'
        ]);
        $jobType = new JobType();
        $jobType = JobType::setData($jobType, $request);
        $jobType->save();
        return redirect()->route('job_type.index');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'abbr' => 'required|max:50|unique:job_types,abbr' , 'name' => 'required|max:200' ] ) ; $ jobType = new JobType ( ) ; $ jobType = JobType :: setData ( $ jobType , $ request ) ; $ jobType -> save ( ) ; return redirect ( ) -> route ( 'job_type.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .