Laravel Excel validation
<p>i have installed the maatwebsite/excel package for laravel. It works fine. My problem is how to handle it after i check the file. </p>

<p>The upload() function in which i show to file forum and where i upload the file is here:</p>

<pre><code>public function upload(Request $request) {

    $orientation = $request-&gt;get('orientation');
    if($request-&gt;file('file')) {
        $status = Excel::load(Input::file('file'), function ($reader) use ($orientation) {
            return self::upload_excel_files($reader, $orientation);
        });
        if($status) {
            Session::flash('status', "Excel data was imported successfully");
            return redirect(route('admin.exchange.upload'));
        }
        else {
            return redirect(route('admin.exchange.upload'))-&gt;withErrors('Invalid format. Please check the XLS template.');
        }
    }
    return view('admin.exchange.upload');

}

public function upload_excel_files($file, $orientation) {
    if(something) return true;
    else return false;
}
</code></pre>

<p>The upload_excel_files function checks if the file has the right format and if yes it handles it and must return a successful note. If the file does not match the require format it needs to give an error message.</p>

<p>Unfortunately i am not sure where to put the user messages. As in the example it always return a successful message. If the messages are in the upload_excel_files() function for some reason i don't get the message by the first redirect, i get it at the second redirect which is strange.</p>

<p>What would u guys recommend me to do ?</p>