Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

raygun's avatar

I'm getting an error in my syntax

I am using php storm and I'm getting an error in my syntax where I have it marked

  elixir(function(mix) { <------------------------------------------------------this opening curly bracket here
  // Copy the files that bower has fetched. Note that gulp tasks run
  // asynchronously. This means a dependent task, such as less(),
  // may run before copy() finishes. If this happens then just
  // run gulp twice. Not an elegant solution, but it works.
  .copy(  mix.copy(
      'vendor/bower_components/jquery/dist/jquery.js',
      'resources/assets/js/jquery.js'
  ).copy(
      'vendor/bower_components/bootstrap/less',
     'resources/assets/less/bootstrap'
  ).copy(
      'vendor/bower_components/bootstrap/dist/js/bootstrap.js',
      'resources/assets/js/bootstrap.js'
  ).copy(
      'vendor/bower_components/bootstrap/dist/fonts',
      'public/assets/fonts'
  )   <-------------------------------------------------------------------and

  // Combine scripts
  mix.scripts([
          'js/jquery.js',
          'js/bootstrap.js'
      ],
      'public/assets/js/admin.js',
      'resources/assets'
  );

  // Compile Less
  mix.less('admin.less', 'public/assets/css');
  });
  could anybody tell me why
0 likes
2 replies
raygun's avatar
raygun
OP
Best Answer
Level 2

fixed it removed the extra copy

fetch404's avatar

You don't need to do that. You were missing a parenthesis.

  elixir(function(mix) { 
  // Copy the files that bower has fetched. Note that gulp tasks run
  // asynchronously. This means a dependent task, such as less(),
  // may run before copy() finishes. If this happens then just
  // run gulp twice. Not an elegant solution, but it works.
  .copy(  mix.copy(
      'vendor/bower_components/jquery/dist/jquery.js',
      'resources/assets/js/jquery.js'
  ).copy(
      'vendor/bower_components/bootstrap/less',
     'resources/assets/less/bootstrap'
  ).copy(
      'vendor/bower_components/bootstrap/dist/js/bootstrap.js',
      'resources/assets/js/bootstrap.js'
  ).copy(
      'vendor/bower_components/bootstrap/dist/fonts',
      'public/assets/fonts'
  ));

  // Combine scripts
  mix.scripts([
          'js/jquery.js',
          'js/bootstrap.js'
      ],
      'public/assets/js/admin.js',
      'resources/assets'
  );

  // Compile Less
  mix.less('admin.less', 'public/assets/css');
});

The above code should work.

Please or to participate in this conversation.