├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .scripts └── deploy.sh ├── LICENSE.md ├── Modules └── .gitkeep ├── README.md ├── SECURITY.md ├── app ├── Http │ └── Controllers │ │ └── Controller.php ├── Models │ └── User.php └── Providers │ └── AppServiceProvider.php ├── art ├── cover.png ├── dashboard-dark-rtl.png ├── dashboard-dark.png ├── dashboard-light.png ├── login-dark.png ├── profile.png ├── roles.png ├── screenshot.png ├── settings.png ├── slideover-light.png ├── table-dark.png ├── table-light.png ├── v1.2 CRUD.png ├── v1.2 dark.png ├── v1.2 dashboard dark.png ├── v1.2 dashboard.png ├── v1.2 home.png ├── v1.2 login.png └── v1.2 profile.png ├── artisan ├── bin ├── serve ├── stop ├── test └── update ├── bootstrap ├── app.php ├── cache │ └── .gitignore ├── providers.php └── ssr │ ├── assets │ └── CompilerErrorMessages-6b34f14b-6b34f14b.mjs │ └── ssr.mjs ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── database.php ├── filesystems.php ├── fortify.php ├── jetstream.php ├── logging.php ├── mail.php ├── media-library.php ├── permission.php ├── queue.php ├── services.php └── session.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 0001_01_01_000000_create_users_table.php │ ├── 0001_01_01_000001_create_cache_table.php │ ├── 0001_01_01_000002_create_jobs_table.php │ └── 2024_04_24_134733_create_media_table.php └── seeders │ └── DatabaseSeeder.php ├── docker-compose.yml ├── lang ├── ar.json ├── de.json └── en.json ├── modules_statuses.json ├── package.json ├── phpunit.xml ├── postcss.config.js ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── resources ├── css │ ├── .DS_Store │ ├── _checkbox-radio-switch.css │ ├── _progress.css │ ├── _scrollbars.css │ ├── _table.css │ ├── app.css │ ├── module.esm.css │ ├── module.esm.js │ └── tailwind │ │ ├── _base.css │ │ ├── _components.css │ │ └── _utilities.css ├── js │ ├── app.js │ ├── bootstrap.js │ ├── choices.scss │ └── ssr.js ├── markdown │ ├── policy.md │ └── terms.md └── views │ ├── emails │ └── team-invitation.blade.php │ ├── root.blade.php │ ├── vendor │ └── media-library │ │ ├── image.blade.php │ │ ├── placeholderSvg.blade.php │ │ ├── responsiveImage.blade.php │ │ └── responsiveImageWithPlaceholder.blade.php │ └── welcome.blade.php ├── routes ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── Feature │ └── ExampleTest.php ├── Pest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── ubuntu-22-install-script ├── vite.config.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_TIMEZONE=UTC 6 | APP_URL=http://localhost 7 | 8 | APP_LOCALE=en 9 | APP_FALLBACK_LOCALE=en 10 | APP_FAKER_LOCALE=en_US 11 | 12 | APP_MAINTENANCE_DRIVER=file 13 | APP_MAINTENANCE_STORE=database 14 | 15 | BCRYPT_ROUNDS=12 16 | 17 | LOG_CHANNEL=stack 18 | LOG_STACK=single 19 | LOG_DEPRECATIONS_CHANNEL=null 20 | LOG_LEVEL=debug 21 | 22 | DB_CONNECTION=mysql 23 | DB_HOST=127.0.0.1 24 | DB_PORT=3306 25 | DB_DATABASE=tomato_v2 26 | DB_USERNAME=root 27 | DB_PASSWORD= 28 | 29 | SESSION_DRIVER=database 30 | SESSION_LIFETIME=120 31 | SESSION_ENCRYPT=false 32 | SESSION_PATH=/ 33 | SESSION_DOMAIN=null 34 | 35 | BROADCAST_CONNECTION=log 36 | FILESYSTEM_DISK=local 37 | QUEUE_CONNECTION=database 38 | 39 | CACHE_STORE=database 40 | CACHE_PREFIX= 41 | 42 | MEMCACHED_HOST=127.0.0.1 43 | 44 | REDIS_CLIENT=phpredis 45 | REDIS_HOST=127.0.0.1 46 | REDIS_PASSWORD=null 47 | REDIS_PORT=6379 48 | 49 | MAIL_MAILER=log 50 | MAIL_HOST=127.0.0.1 51 | MAIL_PORT=2525 52 | MAIL_USERNAME=null 53 | MAIL_PASSWORD=null 54 | MAIL_ENCRYPTION=null 55 | MAIL_FROM_ADDRESS="hello@example.com" 56 | MAIL_FROM_NAME="${APP_NAME}" 57 | 58 | AWS_ACCESS_KEY_ID= 59 | AWS_SECRET_ACCESS_KEY= 60 | AWS_DEFAULT_REGION=us-east-1 61 | AWS_BUCKET= 62 | AWS_USE_PATH_STYLE_ENDPOINT=false 63 | 64 | VITE_APP_NAME="${APP_NAME}" 65 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache 2 | /node_modules 3 | /public/build 4 | /public/hot 5 | /public/storage 6 | /storage/*.key 7 | /vendor 8 | .env 9 | .env.backup 10 | .env.production 11 | .phpunit.result.cache 12 | Homestead.json 13 | Homestead.yaml 14 | auth.json 15 | npm-debug.log 16 | yarn-error.log 17 | /.fleet 18 | /.idea 19 | /.vscode 20 | -------------------------------------------------------------------------------- /.scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo "Deployment started ..." 5 | 6 | # Pull the latest version of the app 7 | git reset --hard 8 | git pull origin master 9 | 10 | # Install composer dependencies 11 | composer install 12 | 13 | # Clear the old cache 14 | php8.2 artisan clear-compiled 15 | 16 | # Recreate cache 17 | php8.2 artisan optimize 18 | 19 | 20 | # Run database migrations 21 | php8.2 artisan migrate --force 22 | 23 | 24 | echo "Deployment finished!" 25 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Fady Mondy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Modules/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomatophp/tomato/fdaef54c4573d422132416947e3ebec667e7441b/Modules/.gitkeep -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Screenshot](https://github.com/tomatophp/tomato/blob/master/art/screenshot.png) 2 | 3 | # Tomato Framework 4 | 5 | 🍅 TomatoPHP is built to make it easy to develop web apps and API by generating files of CRUD operations and support helpers of tonnes of functions to make it easy to manage and use framework services. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | composer create-project tomatophp/tomato 11 | ``` 12 | 13 | ## Support 14 | 15 | you can join our discord server to get support [TomatoPHP](https://discord.gg/Xqmt35Uh) 16 | 17 | ## Docs 18 | 19 | you can check docs of this package on [Docs](https://docs.tomatophp.com) 20 | 21 | ## Changelog 22 | 23 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. 24 | 25 | ## Credits 26 | 27 | - [Fady Mondy](https://github.com/3x1io) 28 | 29 | ## License 30 | 31 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 32 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomatophp/tomato/fdaef54c4573d422132416947e3ebec667e7441b/SECURITY.md -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | protected $fillable = [ 27 | 'name', 28 | 'email', 29 | 'password', 30 | ]; 31 | 32 | /** 33 | * The attributes that should be hidden for serialization. 34 | * 35 | * @var array 36 | */ 37 | protected $hidden = [ 38 | 'password', 39 | 'remember_token', 40 | ]; 41 | 42 | /** 43 | * The attributes that should be cast. 44 | * 45 | * @var array 46 | */ 47 | protected $casts = [ 48 | 'email_verified_at' => 'datetime', 49 | 'password' => 'hashed', 50 | ]; 51 | } 52 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /bin/serve: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fail the whole script if any command fails 4 | set -euo pipefail 5 | trap "echo \"[INFO] To stop the docker container you need to run: bin/stop\"" EXIT 6 | 7 | FRESH=false 8 | 9 | # Delete old environment for new setup 10 | if [ $# -eq 1 ] && [ $1 == '--fresh' ] 11 | then 12 | rm -rf node_modules 13 | rm -rf vendor 14 | rm -f storage/sail/composer.lock 15 | rm -f storage/sail/package-lock.json 16 | rm -f storage/sail/yarn.lock 17 | rm -f storage/sail/docker-compose.yml 18 | rm -f .env 19 | fi 20 | 21 | # Create environment file if it doesn't exist yet 22 | if [ ! -f .env ] 23 | then 24 | sed 's/APP_URL=.*/APP_URL=http:\/\/localhost/g;s/DB_HOST=.*/DB_HOST=mysql/g;s/REDIS_HOST=.*/REDIS_HOST=redis/g;s/MAIL_HOST=.*/MAIL_HOST=mailpit/g' < .env.example > .env 25 | FRESH=true 26 | fi 27 | 28 | # Install needed composer dependencies for Laravel Sail 29 | if [ ! -f vendor/bin/sail ] 30 | then 31 | docker run --rm \ 32 | -u "$(id -u):$(id -g)" \ 33 | -v $(pwd):/var/www/html \ 34 | -w /var/www/html \ 35 | laravelsail/php82-composer:latest \ 36 | composer install --ignore-platform-reqs 37 | fi 38 | 39 | # Create/Sync Docker-Containers based on Docker Compose File 40 | if [ ! -f storage/sail/docker-compose.yml ] || ! cmp --silent -- "docker-compose.yml" "storage/sail/docker-compose.yml" 41 | then 42 | FRESH=true 43 | 44 | vendor/bin/sail stop 45 | vendor/bin/sail build --no-cache --pull 46 | 47 | cp docker-compose.yml storage/sail/docker-compose.yml 48 | fi 49 | 50 | # Get Laravel Sail up and running in the background 51 | vendor/bin/sail up -d --wait 52 | 53 | # Install node dependencies if not installed yet 54 | if [ ! -d node_modules ] 55 | then 56 | 57 | if [ ! -f yarn.lock ] 58 | then 59 | vendor/bin/sail npm install 60 | 61 | # Save currently installed dependencies 62 | cp package-lock.json storage/sail/package-lock.json 63 | else 64 | vendor/bin/sail yarn install 65 | 66 | # Save currently installed dependencies 67 | cp yarn.lock storage/sail/yarn.lock 68 | fi 69 | 70 | fi 71 | 72 | # Install latest composer dependencies, if out of sync 73 | if ! cmp --silent -- "composer.lock" "storage/sail/composer.lock" 74 | then 75 | vendor/bin/sail composer install 76 | 77 | # Save currently installed dependencies 78 | cp composer.lock storage/sail/composer.lock 79 | fi 80 | 81 | # Install latest npm dependencies, if out of sync 82 | if ! cmp --silent -- "package-lock.json" "storage/sail/package-lock.json" 83 | then 84 | 85 | if [ ! -f yarn.lock ] 86 | then 87 | vendor/bin/sail npm install 88 | 89 | # Save currently installed dependencies 90 | cp package-lock.json storage/sail/package-lock.json 91 | else 92 | vendor/bin/sail yarn install 93 | 94 | # Save currently installed dependencies 95 | cp yarn.lock storage/sail/yarn.lock 96 | fi 97 | 98 | fi 99 | 100 | # Migrate Database to the newest version 101 | if $FRESH 102 | then 103 | vendor/bin/sail artisan migrate:fresh --seed --force 104 | else 105 | vendor/bin/sail artisan migrate --force 106 | fi 107 | 108 | 109 | # Start the Development Server 110 | 111 | if [ ! -f yarn.lock ] 112 | then 113 | vendor/bin/sail npm run dev 114 | else 115 | vendor/bin/sail yarn run dev 116 | fi 117 | -------------------------------------------------------------------------------- /bin/stop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fail the whole script if any command fails 4 | set -euo pipefail 5 | 6 | # Stop Laravel Sail and the docker containers 7 | vendor/bin/sail stop 8 | -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Display Help Text 4 | if [ $# -eq 1 ] && [ $1 == '--help' ] 5 | then 6 | echo "Usage: bin/test [--tests|--dusk]" 7 | echo "--tests : Only run unit and feature tests" 8 | echo "--dusk : Only run dusk tests" 9 | exit 0 10 | fi 11 | 12 | # Fail the whole script if any command fails 13 | set -euo pipefail 14 | trap "echo \"[INFO] To stop the docker container you need to run: bin/stop\"" EXIT 15 | 16 | # Get Laravel Sail up and running in the background 17 | vendor/bin/sail up -d --wait 18 | 19 | # Run unit and feature tests 20 | if [[ $# -eq 0 ]] || [[ $1 == '--tests' ]] 21 | then 22 | vendor/bin/sail test --stop-on-failure 23 | fi 24 | 25 | # Run dusk tests 26 | if [[ $# -eq 0 ]] || [[ $1 == '--dusk' ]] 27 | then 28 | vendor/bin/sail artisan migrate:fresh --env=dusk --force --quiet 29 | vendor/bin/sail dusk --env=dusk --stop-on-failure 30 | fi 31 | 32 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fail the whole script if any command fails 4 | set -euo pipefail 5 | trap "echo \"[INFO] To stop the docker container you need to run: bin/stop\"" EXIT 6 | 7 | # Get Laravel Sail up and running in the background 8 | vendor/bin/sail up -d --wait 9 | 10 | # Update composer dependencies 11 | vendor/bin/sail composer update 12 | cp composer.lock storage/sail/composer.lock 13 | 14 | # Update dependencies 15 | if [ ! -f yarn.lock ] 16 | then 17 | vendor/bin/sail npm update 18 | vendor/bin/sail npm run build 19 | cp package-lock.json storage/sail/package-lock.json 20 | else 21 | vendor/bin/sail yarn upgrade 22 | vendor/bin/sail yarn run build 23 | cp yarn.lock storage/sail/yarn.lock 24 | fi 25 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 9 | web: __DIR__.'/../routes/web.php', 10 | commands: __DIR__.'/../routes/console.php', 11 | health: '/up', 12 | ) 13 | ->withMiddleware(function (Middleware $middleware) { 14 | $middleware->group('splade', [ 15 | \ProtoneMedia\Splade\Http\SpladeMiddleware::class 16 | ]); 17 | }) 18 | ->withExceptions(function (Exceptions $exceptions) { 19 | $exceptions->renderable(\ProtoneMedia\Splade\SpladeCore::exceptionHandler($exceptions->handler)); 20 | })->create(); 21 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | key should be placed on the