Skip to content

Instantly share code, notes, and snippets.

@peterfox
Created June 14, 2026 00:54
Show Gist options
  • Select an option

  • Save peterfox/f669f604b4751cff19668c29da8f20ea to your computer and use it in GitHub Desktop.

Select an option

Save peterfox/f669f604b4751cff19668c29da8f20ea to your computer and use it in GitHub Desktop.
Laravel Installer: Fix --github option and add --public flag

Fixed

  • The --github option uses Symfony Console's VALUE_OPTIONAL mode, which silently consumes the next positional argument as the option value when no = separator is used. Running laravel new --github my-app caused my-app to be captured as the option value rather than the project name, and the installer would prompt for the name again before building a broken gh repo create command with the project name duplicated in the flags position — e.g. gh repo create my-app --source=. --push my-app.

Changed

  • The --github option now accepts an optional repository name, allowing the GitHub repository to be named differently from the project directory:

    laravel new my-app --github=my-different-repo-name
    
  • A new --public flag controls the visibility of the created GitHub repository. The default remains private, matching the previous behaviour:

    laravel new my-app --github --public
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment