I have the following code in my Laravel 5 app:
public function store(Request $request){ $this->validate($request,
Might be easiest to use the built in alpha-numeric validation:
https://laravel.com/docs/5.2/validation#rule-alpha-num $validator = Validator::make($request->all(), [ 'filename' => 'alpha_num', ]);