Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,57 @@ APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost

GITPOD_VITE_URL=

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database

PHP_CLI_SERVER_WORKERS=4

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=example_app
DB_USERNAME=root
DB_PASSWORD=
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Expand All @@ -45,16 +65,4 @@ AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
VITE_APP_NAME="${APP_NAME}"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
Homestead.json
Homestead.yaml
Expand All @@ -17,3 +19,4 @@ yarn-error.log
/.fleet
/.idea
/.vscode
/.zed
6 changes: 2 additions & 4 deletions .gitpod.welcome-message
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
| |__| | | |_| |_) | (_) | (_| | | (_> < | |___| (_| | | | (_| |\ V / __/ |
\_____|_|\__| .__/ \___/ \__,_| \___/\/ |______\__,_|_| \__,_| \_/ \___|_|
| |
|_|
|_|



Sail is ready. You can now work on this terminal. Vite will run in a 2nd terminal.


Laravel is ready. Vite will run in a 2nd terminal.
12 changes: 2 additions & 10 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
tasks:
- name: Setup environment and PHP/Composer dependencies
openMode: split-left
# Fix because of https://github.com/gitpod-io/gitpod/issues/16614
#before: sudo curl -o /usr/local/bin/docker-compose -fsSL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-$(uname -m)
init: |
cp .env.example .env &&
sed -i "s#APP_URL=http://localhost#APP_URL=$(gp url 8000)#g" .env
sed -i "s#GITPOD_VITE_URL=#GITPOD_VITE_URL=$(gp url 5173)#g" .env
touch database/database.sqlite
composer install --ignore-platform-reqs
php artisan key:generate
php artisan storage:link
php artisan migrate:fresh --seed
php artisan serve

- name: Install Node dependencies and run Vite
Expand All @@ -18,15 +18,7 @@ tasks:
npm install
npm run dev

- name: Start DB
openMode: split-right
command: |
docker compose up -d

ports:
- port: 3306
onOpen: ignore
name: MySQL Database Port
- port: 5173
onOpen: ignore
visibility: public
Expand Down
70 changes: 3 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# A Laravel with MySQL template on Gitpod
# Laravel template on Gitpod

This is a [Laravel with MySQL](https://laravel.com) template configured for ephemeral development environments on [Gitpod](https://www.gitpod.io/).
This is a [Laravel](https://laravel.com) template configured for ephemeral development environments on [Gitpod](https://www.gitpod.io/).

## Next Steps

Click the button below to start a new development environment:

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/template-php-laravel-mysql)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-samples/template-laravel)

## Get Started With Your Own Project

Expand All @@ -17,67 +17,3 @@ Click the above "Open in Gitpod" button to start a new workspace. Once you're re
### An existing project

To get started with Laravel with MySQL on Gitpod, add a [`.gitpod.yml`](./.gitpod.yml) file which contains the configuration to improve the developer experience on Gitpod. To learn more, please see the [Getting Started](https://www.gitpod.io/docs/getting-started) documentation.

## Notes & caveats

The database does not get automatically migrated. Once started, we should run `php artisan migrate`, after the DB service is ready. It should be a few moments.

If you want to try a Laravel Breeze scaffolding, then you should be aware that files will be changed, and you will to revert some content.

You will have to do these steps:

```
composer require laravel/breeze --dev

php artisan breeze:install blade # or vue or react

# Revert changes on `vite.config.js` file, as accordingly on the next code block

# Then you can again recompile
npm run dev

# Go the the browser URL of port 8000. Make sure to open browser inspector, to reload all assets.
```


This is the look `vite.config.js` should be after installing the `Blade` flavour of Breeze.
If you chose another one, let's look at what should be replaced back in:

- The `dotenv` import and its configuration invoke.
- The definition of `extendedViteDevServerOptions`, plus conditionally change it, plus adding it to the vite config object.

Here it is the final look:

```
import {defineConfig} from 'vite'
import laravel from 'laravel-vite-plugin'
import dotenv from 'dotenv'

dotenv.config()

const extendedViteDevServerOptions = {}

if (process.env.GITPOD_VITE_URL) {
extendedViteDevServerOptions.hmr = {
protocol: 'wss',
host: new URL(process.env.GITPOD_VITE_URL).hostname,
clientPort: 443
}
}

export default defineConfig({
server: {
...extendedViteDevServerOptions
},
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
})

```
27 changes: 0 additions & 27 deletions app/Console/Kernel.php

This file was deleted.

48 changes: 0 additions & 48 deletions app/Exceptions/Handler.php

This file was deleted.

8 changes: 2 additions & 6 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
abstract class Controller
{
use AuthorizesRequests, ValidatesRequests;
//
}
67 changes: 0 additions & 67 deletions app/Http/Kernel.php

This file was deleted.

Loading