app/Http/Controllers/ImportController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function UploadList(Request $request)
    { 
      $this->validate($request, [
      'select_file'  => 'required'
     ]);
    $path = $request->file('select_file')->getRealPath();
     $data = Excel::import(new BulkImport, $request->file('select_file') );
     $import = new BulkImport;
    if ($import->failures()->isNotEmpty()) {
            return back()->withFailures($import->failures());
        }
     return back()->with('success', 'Data Imported successfully.');
    }
public function UploadList ( Request $ request ) { $ this -> validate ( $ request , [ 'select_file' => 'required' ] ) ; $ path = $ request -> file ( 'select_file' ) -> getRealPath ( ) ; $ data = Excel :: import ( new BulkImport , $ request -> file ( 'select_file' ) ) ; $ import = new BulkImport ; if ( $ import -> failures ( ) -> isNotEmpty ( ) ) { return back ( ) -> withFailures ( $ import -> failures ( ) ) ; } return back ( ) -> with ( 'success' , 'Data Imported successfully.' ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .