<?php
namespace App\Http\Validators;

use Illuminate\Support\Facades\Validator;

class JobValidator{

    public static function validate($data){
        $validator = Validator::make($data, [
            'title'         => 'required|max:100',
            'location'      => 'required|max:191',
            'type'          => 'required',
            'email'         => 'required|email',
            'currency'      => 'required',     
            'min_salary'    => 'required|numeric',
            'max_salary'    => 'required|numeric',
            'description'   => 'required|max:1000',
        ]);

        if($validator->fails()){
            return array(
                'status' => false,
                'errors' => $validator->errors()
            );
        }

        return array(
            'status' => true
        );
    }
}
