I'm a newbie in PHP, so now i need to validate model with static variable.
This is what i have
class Setting extends Model {
protected $table = 'settings';
public static $rules = [
'skey' => 'required|unique:table,id,' . Route::input('settings')
];
}
It throws following error : syntax error, unexpected '.', expecting ']'
Ok, I understand that can not used in declaring variable.
Now, this is my question:
- How can I done this with Illuminate\Http\Request, I dont want to create a new SettingRequest that can use easier.
- I also dont want use in store or update method in controller. I want to use this way in both 2 method create/update.
- In PHP, anyway to create setter or getter as C#.