arkecosystem / foundation
User-Interface Scaffolding for Laravel. Powered by Tailwind CSS.
Installs: 98 409
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 4
Open Issues: 2
Requires
- php: ^8.0
- calebporzio/sushi: ^2.4
- danharrin/livewire-rate-limiting: ^1.1
- driftingly/rector-laravel: ^0.21
- elgigi/commonmark-emoji: ^2.0
- ergebnis/phpstan-rules: ^1.0
- fakerphp/faker: ^1.23
- friendsofphp/php-cs-fixer: ^3.19
- google/recaptcha: ^1.3
- graham-campbell/analyzer: ^3.0
- guzzlehttp/guzzle: ^7.7
- illuminate/bus: ^10.0
- illuminate/contracts: ^10.0
- illuminate/http: ^10.0
- illuminate/mail: ^10.0
- illuminate/support: ^10.0
- illuminate/view: ^10.0
- jamesmills/laravel-timezone: ^1.13
- jasonmccreary/laravel-test-assertions: ^2.3
- jenssegers/agent: ^2.6
- laravel/fortify: ^1.21
- laravel/telescope: ^5.0
- league/commonmark: ^2.4
- livewire/livewire: ^3.0
- mockery/mockery: ^1.6
- nunomaduro/collision: ^7.0
- nunomaduro/larastan: ^2.6
- pestphp/pest: ^2.0
- pestphp/pest-plugin-faker: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- pestphp/pest-plugin-livewire: ^2.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^10.0
- pragmarx/google2fa-laravel: ^2.1
- rector/rector: ^0.19
- ruafozy/mersenne-twister: ^1.0
- spatie/laravel-flash: ^1.9
- spatie/laravel-honeypot: ^4.3
- spatie/laravel-medialibrary: ^10.10
- spatie/laravel-newsletter: ^5.1
- spatie/laravel-package-tools: ^1.15
- spatie/laravel-personal-data-export: ^4.2
- spatie/laravel-responsecache: ^7.4
- spatie/laravel-schemaless-attributes: ^2.4
- spatie/laravel-sluggable: ^3.5
- spatie/pest-plugin-snapshots: ^2.0
- spatie/regex: ^3.1
- spatie/yaml-front-matter: ^2.0
Requires (Dev)
- orchestra/testbench: ^8.22
- spatie/mailcoach-sdk-php: ^1.4
- dev-main
- 18.0.0
- 17.0.0
- 16.3.0
- 16.2.0
- 16.1.0
- 16.0.0
- 15.0.0
- 14.1.0
- 14.0.0
- 13.35.0
- 13.34.0
- 13.33.0
- 13.32.0
- 13.31.0
- 13.30.0
- 13.29.1
- 13.29.0
- 13.28.0
- 13.27.0
- 13.26.0
- 13.25.0
- 13.24.0
- 13.23.0
- 13.22.0
- 13.21.0
- 13.20.0
- 13.19.0
- 13.18.0
- 13.17.0
- 13.16.1
- 13.16.0
- 13.15.0
- 13.14.0
- 13.13.0
- 13.12.0
- 13.11.0
- 13.10.0
- 13.9.0
- 13.8.0
- 13.7.0
- 13.6.0
- 13.5.1
- 13.5.0
- 13.4.0
- 13.3.0
- 13.2.0
- 13.1.0
- 13.0.0
- 12.19.0
- 12.18.0
- 12.17.0
- 12.16.0
- 12.15.0
- 12.14.0
- 12.13.0
- 12.12.0
- 12.11.0
- 12.10.0
- 12.9.1
- 12.9.0
- 12.8.0
- 12.7.1
- 12.7.0
- 12.6.0
- 12.5.0
- 12.4.0
- 12.3.0
- 12.2.0
- 12.1.0
- 12.0.0
- 11.9.1
- 11.9.0
- 11.8.0
- 11.7.0
- 11.6.0
- 11.5.0
- 11.4.0
- 11.3.0
- 11.2.1
- 11.2.0
- 11.1.0
- 11.0.3
- 11.0.2
- 11.0.1
- 11.0.0
- 10.18.2
- 10.18.1
- 10.18.0
- 10.17.0
- 10.16.0
- 10.15.0
- 10.14.0
- 10.13.0
- 10.12.1
- 10.12.0
- 10.11.0
- 10.10.0
- 10.9.0
- 10.8.1
- 10.8.0
- 10.7.0
- 10.6.0
- 10.5.0
- 10.4.0
- 10.3.0
- 10.2.0
- 10.1.3
- 10.1.2
- 10.1.1
- 10.1.0
- 10.0.0
- 9.2.0
- 9.1.1
- 9.1.0
- 9.0.1
- 9.0.0
- 8.1.1
- 8.1.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0
- 0.0.15
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.10
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-chore/update-laravel
- dev-refactor/handle-overriding-currency-decimal-places
- dev-chore/update-php-packages
- dev-refactor/allow-external-link-icon-override
- dev-barbslex
This package is auto-updated.
Last update: 2024-10-07 12:17:49 UTC
README
Scaffolding for Laravel. Powered by Tailwind CSS and Livewire.
List of the available components
Prerequisites
Since this package relies on a few 3rd party packages, you will need to have the following installed and configured in your project:
Installation
Require with composer: composer require arkecosystem/foundation
Usage
Examples
Composer Scripts
Add those scripts to composer.json
"scripts": [ "analyse": [ "vendor/bin/phpstan analyse --configuration=vendor/arkecosystem/foundation/phpstan.neon --memory-limit=2G" ], "format": [ "vendor/bin/php-cs-fixer fix --config=vendor/arkecosystem/foundation/.php-cs-fixer.php" ], "refactor": [ "./vendor/bin/rector process --config=vendor/arkecosystem/foundation/rector.php" ], "test": [ "./vendor/bin/pest" ], "test:fast": [ "./vendor/bin/pest --parallel" ], "test:coverage": [ "./vendor/bin/pest --coverage --min=100 --coverage-html=.coverage --coverage-clover=coverage.xml" ] ],
Working on Components Locally
This package contains a lot of frontend components, but no frontend views itself. So when you need to work on it, you rely on the frontend from another project. Usually this can be done by having composer symlink this package, but in this case there is a second step required to ensure you can run yarn watch
, yarn prod
etc.
I'll get into it in detail and will use the marketsquare.io project as an example. Let's assume that both the marketsquare.io and laravel-foundation git repo's are installed in the /Users/my-user/projects/
folder on our local development machine.
Step 1 - Composer Symlink
In the composer.json
file from marketsquare.io under "repositories" add the laravel-foundation as a path:
"repositories": [ { "type": "path", "url": "../laravel-foundation" } ]
After that run composer require arkecosystem/foundation --ignore-platform-reqs -W
. The laravel-foundation package is now symlinked and you can work in your IDE from within your laravel-foundation
repo.
Step 2 - Symlink node_modules
If you would run yarn watch
from within your marketsquare.io repo you'll get a lot of errors because dependencies are not smart enough to know they're in a symlinked directory.
- Delete the
node_modules
directory onlaravel-foundation
. - Symlink the
node_modules
directory from marketsquare.io to laravel-foundation by runningln -s /Users/my-user/projects/marketsquare.io/node_modules node_modules
(from within your laravel-foundation repo).
Now, when you go back to your marketsquare.io repo, you can run yarn watch
.
Don't forget to remove the symlinking after you're done.
Turn those steps into scripts
Keep in mind:
these scripts are written for Mac users. If you use another OS you may need to tweak them accordingly.
unlink:foundation
usesgit
commands to restore the current project.
To improve your workflow you can turn those steps into scripts and use them directly in your command line, like:
$ link:foundation $ unlink:foundation
You can copy/paste them in your .bashrc
, .aliases
or whatever file you set up to manage your aliases.
Before jumping into the code, let me explain what you can do with them (skip to code).
For these examples we use marketsquare.io
and laravel-foundation
repos, assuming that both are installed in the same folder (/Users/my-user/projects
) on our local development machine.
symlink your current project to laravel-foundation
# move into marketsquare.io folder $ cd /Users/my-user/projects/marketsquare.io # symlink to laravel-foundation repo $ link:foundation
That's it!
The script automatically tries to guess where the laravel-foundation
repo is located and symlinks the current project to it (in this case marketsquare.io
).
If the current project and laravel-foundation
repos are not in the same folder, the script tries to move one level back (../../
) and tries again.
If laravel-foundation
is not found, the script exits and outputs an error message.
You can always specify a custom path, by passing it as an argument
$ link:foundation 'Users/john/repos/laravel-foundation'
remove symlink from your current project
# move into marketsquare.io folder $ cd /Users/my-user/projects/marketsquare.io # remove symlink $ unlink:foundation
Again, that's it!
The script looks for .symlink_foundation
temp file (created by link:foundation
), that contains the symlinked path.
If not found, it tries to guess where the laravel-foundation
repo is located and removes the symlink from the current project (in this case marketsquare.io
).
If the current project and laravel-foundation
repos are not in the same folder, the script tries to move one level back (../../
) and tries again.
If laravel-foundation
is not found, the script exits and outputs an error message.
You can always specify a custom path, by passing it as an argument
$ unlink:foundation 'Users/john/repos/laravel-foundation'
code
Scripts are self-explanatory, plus they have comments on each line 😉.
function link:foundation() { # Check if already symlinked [ -f .symlink_foundation ] && { echo "already symlinked"; return; } # Get path from args or guess it if [ "$1" != "" ]; then FOUNDATION="$1" elif [ -d ../laravel-foundation ]; then FOUNDATION="../laravel-foundation" elif [ -d ../../laravel-foundation ]; then FOUNDATION="../../laravel-foundation" else echo "Unable to find `laravel-foundation`" return fi # Generate random string RANDOM_STRING=$(base64 /dev/urandom | tr -d '/+' | dd bs=6 count=1 2>/dev/null) # Set Composer repo composer config repositories.${RANDOM_STRING} '{"type": "path", "url": "'${FOUNDATION}'"}' # Require arkecosystem/foundation composer require arkecosystem/foundation --ignore-platform-reqs -W # Remove node_modules folder rm -rf ${FOUNDATION}/node_modules # Symlink to arkecosystem/foundation node_modules folder ln -s $(pwd)/node_modules ${FOUNDATION}/node_modules # Create .symlink_foundation temp file echo ${FOUNDATION} >> .symlink_foundation # Inform user that all went ok echo "${FOUNDATION} has been symlinked" } function unlink:foundation() { # Get path from .symlink_foundation file or from args or guess it if [ -f .symlink_foundation ]; then FOUNDATION=$(cat .symlink_foundation) elif [ "$1" != "" ]; then FOUNDATION="$1" elif [ -d ../laravel-foundation ]; then FOUNDATION="../laravel-foundation" elif [ -d ../../laravel-foundation ]; then FOUNDATION="../../laravel-foundation" else echo "Unable to find `laravel-foundation`" return fi # Remove symlink unlink ${FOUNDATION}/node_modules # Remove temp file rm -rf .symlink_foundation # Clean up repo git reset --hard git clean -df # Inform user that all went ok echo "${FOUNDATION} symlink has been removed" }