Coder Social home page Coder Social logo

niclasvaneyk / initializer-for-laravel Goto Github PK

View Code? Open in Web Editor NEW
79.0 1.0 9.0 2.32 MB

๐Ÿš€ย A quickstart generator for Laravel projects

Home Page: https://laravel.initializer.dev

License: MIT License

Shell 0.80% PHP 73.42% Blade 22.76% Dockerfile 3.01%
laravel project-template php project-creation developer-tool

initializer-for-laravel's Introduction

๐Ÿš€ Initializer for Laravel

Initializer for Laravel takes a visual, approach to setting up a new Laravel project. Fill out the form, choose the components you like and hit the red "Generate" button at the bottom to download a zip archive containing your fresh application. Once you've extracted the archive, execute ./initialize in your terminal and the script will install all components into your application.

Features

  • Overview of all first-party and directly related components of the Laravel ecosystem
  • Sharable links to re-use your current configuration for your next project
  • Automatic installation - no need to manually execute e.g. php artisan scout:install

Contributing

This project is developed using Laravel Sail. After you installed all dependencies, the site should be running on http://localhost:8000. Use vendor/bin/sail npm run watch to compile the frontend assets and vendor/bin/sail artisan initializer:update-template to quickly download the latest version of default laravel/laravel application into your storage.

A devcontainer.json configuration is prepared, so you can easily contribute through a GitHub code space or develop inside a container using VS Code. In this case a lot of the setup process is automated for you. If you want better auto-completion or auto-imports, follow the the intelephense extension quick start guide.

initializer-for-laravel's People

Contributors

dependabot[bot] avatar niclasvaneyk avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

initializer-for-laravel's Issues

Invalid Service: mailhog (replaced by mailpit)

Describe The Bug

Invalid services [mailhog].

Looking at laravel docs, it seems like mailhog has been changed for mailpit.

Chosen Packages & Configuration
https://laravel.initializer.dev/?preset&vendor=me&php=8.2&starter=laravel&database=mariadb&cache=redis&queue=redis&mail=mailgun&uses-fortify&uses-dbal&uses-mailhog&uses-telescope&uses-pest

  1. Laravel Starter
  2. MariaDB Database
  3. Redis Cache
  4. Redis Queue
  5. Mailgun Driver
  6. Fortify auth
  7. DBAL
  8. Mailhog
  9. Telescope
  10. Pest

Command Line Output

Invalid services [mailhog].

Followed by "It looks like something went wrong [...] create an issue".

Proposed fix

Replace Mailhog by Mailpit.

Composer could not find a composer.json file in /opt

Hi there!

I've tried to initialize a Laravel project with the initializer running sh .\initialize but when I run the script the bash shouts me this:

Running initial installation inside 'initializerforlaravel/sail-php-8.1:latest'
Composer could not find a composer.json file in /opt
To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage      

I'm working with Windows 10 Pro, Intel Core i5-4570 x64 and a 8GB RAM.

My setup for the initializer was:

  • PHP Version: 8.1
  • Starter Kit: Jetstream Inertia (no team)
  • Auth: Sanctum
  • Database: MySQL
  • Cache: Memcached
  • Mail: Mailgun
  • Broadcasting: Soketi
  • Search: MeiliSearch
  • Development Tools: Telescope & Envoy
  • Testing: Pest

Thanks for the help!

Support `soketi` service

It seems like there will be a new soketi service in the next release (see laravel/sail#532).

This should be reflected and automatically included when the relevant option is selected.

Sometimes the database is not ready when migrating

Problem

Sometimes, especially when choosing the default starter kit, the database is not ready to accept connections. This leads to an error similar to this one:

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โ”ƒ ๐Ÿš€ Migrate the database
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

./vendor/bin/sail artisan migrate

   Illuminate\Database\QueryException

  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:703
    699โ–•         // If an exception occurs when attempting to run a query, we'll format the error
    700โ–•         // message to include the bindings with SQL, which will make this exception a
    701โ–•         // lot more helpful to the developer instead of just the database's errors.
    702โ–•         catch (Exception $e) {
  โžœ 703โ–•             throw new QueryException(
    704โ–•                 $query, $this->prepareBindings($bindings), $e
    705โ–•             );
    706โ–•         }
    707โ–•     }

      +36 vendor frames
  37  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Solutions

To fix this, we would need to somehow detect, whether the database is ready or not, maybe by calling sail tinker -c "DB::isReady()" or something like it.

Less contrasty borders in dark mode

Currently there is no customization for the border color in dark mode. This leads to the borders very bright, which increases the contrast to the background and overall makes looking at the site a bit hard.

After loking at the GitHub dark mode, I guess the border-opacity in general should be lowered to 0.75 or something, ideally to match the muted-text color or even darker.

Composer error during ./initialize

After downloading the zipfile and running ./initialize the following error occurred;

`Running initial installation inside 'laravelsail/php80-composer:latest'
No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires laravel/horizon ^0.1.0 -> satisfiable by laravel/horizon[v0.1.0].
- Conclusion: don't install laravel/framework v8.70.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v8.70.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v8.70.0 (conflict analysis result)
- laravel/horizon v0.1.0 requires illuminate/support ~5.4 -> satisfiable by illuminate/support[v5.4.0, ..., 5.8.x-dev].
- Only one of these can be installed: illuminate/support[dev-master, v5.4.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev], laravel/framework[v8.70.0, v8.70.1, v8.70.2, 8.x-dev]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
- Root composer.json requires laravel/framework ^8.70 -> satisfiable by laravel/framework[v8.70.0, v8.70.1, v8.70.2, 8.x-dev].`

In the composer file the following package versions are set;

"require": { .... "laravel/framework": "^8.65", ... }, "require-dev": { ... "laravel/horizon": "^0.1.0", ... },

The chose packages and configurations can be found through this link; https://laravel.initializer.dev/?preset&vendor=fladderen&php=8.0&starter=breeze&database=mysql&cache=redis&queue=redis&uses-horizon&uses-telescope&uses-mailhog

For now I was able to fix this by manually updating Laravel and Horizon to their latest versions. It seems that especially Horizon wasn't set properly;

"require": { ... "laravel/framework": "^8.70", ... }, "require-dev": { ... "laravel/horizon": "^5.7.15", ... },

Run Static Analysis During CI

Seems like #69 could have been somewhat prevented by doing this. Also psalm and phpstan are already configured for local development, so it should not take much effort to configure them to run in CI.

Website Problem

Hi,

when i click on generate on your website, i response an 404

Cheers
Ralf

Check for ports in use

MinIO uses ports 9000 and 8900 on the host system. If you use phpstorm and are currently listening for xdebug connections, it will use port 9000 by default.

This means, that the initialize script will start, but surely fail when calling docker-compose up.

A similar issue can be observed on systems, where e.g. the apache web server is included and started by default (I think Ubuntu does this) on port 80.

using nc, which is hopefully available on most systems (otherwise maybe we can use containers?), one can check the availabilitiy (minio is running):

โฏ nc -z localhost 9000                                  
Connection to localhost port 9000 [tcp/cslistener] succeeded! 
โฏ nc -z localhost 8001                                 

Server error on clicking generate

The settings below generate a server error;

https://laravel.initializer.dev/?preset&vendor=fladderen&php=8.0&starter=breeze&database=mysql&flysystem-cached=flysystem-cached&cache=redis&queue=redis&cashier=mollie&uses-horizon&uses-telescope&uses-mailhog

Created with the share button. Little side note; the share button does not include the app name and needs to be manually added.

Update; When I select none in the Payment & Billing section instead of Mollie the zip is created.

Catch errors in .`/initialize`

And prompt a link to open an issue on GitHub. Otherwise mistakes in the generation of the script may be hard to uncover.

$ ./initialize - Error in Git Bash (MINWG64)

@NiclasvanEyk
Hi Niclas,
I wanted to try your Laravel Initializer and proceeded as per the instructions. (Really like the concept btw !)
However, I'm having a problem getting the complete initialization script to continue in my Bash terminal.
I followed your instruction note at the end of the Initializer page where the project is downloaded.
Unzipped the file into the project folder on C:\Docker-Projects\adpc-laravel-project and opened the bash terminal inside the project folder.

Here is the output data from my terminal
`
andre@Andre-Lenovo MINGW64 /c/Docker-Projects/adpc-laravel-project
$ ./initialize

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โ”ƒ ๐Ÿš€ Initializer for Laravel
โ”ƒ
โ”ƒ This script will complete the rest of the setup needed to install the
โ”ƒ chosen components into your fresh application. This might require
โ”ƒ downloading Docker containers or requiring packages via composer
โ”ƒ multiple times, so it can take a while to complete.
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Press any key to continue
`
So, the script starts, and after hitting enter to continue it throws an error from the daemon about an "absolute path" required.

`Press any key to continue

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โ”ƒ ๐Ÿš€ Install dependencies and set up Laravel Sail
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Running initial installation inside 'initializerforlaravel/sail-php-8.1:latest'
docker: Error response from daemon: the working directory 'C:/Program Files/Git/opt' is invalid, it needs to be an absolute path.
See 'docker run --help'.

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โ”ƒ ๐Ÿ’ฅ It looks like something went wrong!
โ”ƒ
โ”ƒ Feel free to open an issue on GitHub by clicking on the link below.
โ”ƒ
โ”ƒ Make sure to include helpful information such as:
โ”ƒ - the error output above
โ”ƒ - the configuration chosen before downloading the archive
โ”ƒ - your local environment (operating system, etc.)
โ”ƒ - other information that seems relevant to you
โ”ƒ
โ”ƒ https://github.com/NiclasvanEyk/initializer-for-laravel/issues/new
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

andre@Andre-Lenovo MINGW64 /c/Docker-Projects/adpc-laravel-project
$
`
I tried to find more information on the error:

I went to try and find a solution, but the double-slash ".//initializer" does not work either. Please advise.
But neither of the proposals work in my case.

My Laravel Initializer Config Link

My system:
Win 10 Pro 64 - Version (Build): 21H2 (10.0.19044)
WSL2 on Ubuntu 20.04
Docker Desktop 4.8.2.0

Your guidance is appreciated.
Thanks.

โœ‰๏ธ Mail Section

The Mail docs also mention several drivers. We should offer options for those.

Results from search:

  • composer require symfony/mailgun-mailer
  • composer require symfony/postmark-mailer
  • composer require aws/aws-sdk-php
  • composer require symfony/sendinblue-mailer

Docker configuration

@NiclasvanEyk what do you think about add Docker configuration for easy development in many environments like Linux, Windows, macOS etc. . I think about downloaded files in zip archive not this repo.

๐ŸŽ Add Octane Section

Maybe we can add a section for laravel/octane and automate the setup. This might introduce the need to run adjustments before actually starting sail, as the docs suggest adjusting a supervisor command and rebuilding the images.:

command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan octane:start --server=roadrunner --host=0.0.0.0 --rpc-port=6001 --port=8000

If we know beforehand, that octane will be used it makes sense to do this before starting sail.

The Section may be titled something like "Platform", "Async", "Performance" or just straight up "Octane". Similar to the "Search" section it will consist of a choice component with the options:

  • None (default)
  • Roadrunner
  • Swoole

Depending on this choice, the libraries would be installed and the supervisor config would be adjusted.

Jetstream install error

Describe The Bug
A clear and concise description of what the bug is.

Chosen Packages & Configuration

  1. Laravel JetStream
  2. Mysql Database
  3. Sanctum, Passport, [Socialize]
  4. SFTP, AWS S3
  5. Cache: Redis
  6. Queue: Redis
  7. Broadcasting :Pusher
  8. Search : MeiliSearch
  9. Development Tools : Envoy
  10. Testing : Dusk
    Command Line Output
    ./vendor/bin/sail artisan jetstream:install --teams livewire

ErrorException

copy(/var/www/html/config/jetstream.php): Failed to open stream: Permission denied

at vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:319
315โ–• * @return bool
316โ–• /
317โ–• public function copy($path, $target)
318โ–• {
โžœ 319โ–• return copy($path, $target);
320โ–• }
321โ–•
322โ–• /
*
323โ–• * Create a symlink to the target file or directory. On Windows, a hard link is created if the target is a file.

  +29 vendor frames 

30 artisan:37
Illuminate\Foundation\Console\Kernel::handle()

Write at least one full integration test

This probably should be done using a docker-in-docker container to simulate a local installation. Everything should at leasts succeed and a few validations should be done on, e.g. the composer.json file, to see that the expected packages were resolved.

Add `chown` to initialize script

Title is mostly self-explanatory, some files are owned by root user after running ./initialize script because they were installed by Docker.

My suggestion is to add a chown command somewhere in the ./initialize script.

This sudo chown -R $USER: . would do it.

Inspiration can be taken from https://laravel.build/test-project

Wrap zip contents in folder for certain OSes

When decompressing an archive on a Mac, the default archive tool seems to automatically create folder based on the name of the archive. This is not the case on all operating systems and can be very frustrating. Imagine decompressing a Laravel project right on your ~/Documents instead of an enclosing folder. Now you have to carefully move all files originating from the Laravel app inside a folder that you have to create and the whole experience is terrible.

I suggest to make an overview how the default archiving tools on each platforms behave and then do UA detection and wrap the app in an additional folder. Maybe it also makes sense to see how https://start.spring.io handles this problem.

Overview

OS Archive Unzipped
MacOS
Windows
Linux (Ubuntu)

Statistics

It would be fun/interesting to see, which options are popular, or how many applications were downloaded through Initializer for Laravel.

Currently there are logs for starter/database, but only I can see those, so a separate Statistics page would be nice. Everything would need to be stored totally anonymous though, so don't store the project name or other things.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.