Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel excel check if column exists

public function import()
{
  $columns = (new HeadingRowImport)->toArray('users.xlsx');

  if (isset($column['firstname']) && isset($column['lastname']) &&  isset($column['username'])) {
    // columns found - put your code here
  }else{
    // columns not all found, handle error here
 }}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #excel #check #column #exists
ADD COMMENT
Topic
Name
6+2 =