-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Filament Demo, along with improvements to the Docker setup
- Loading branch information
1 parent
9ad49b3
commit c3d9283
Showing
225 changed files
with
15,258 additions
and
2,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,54 @@ | ||
FROM php:8.3-alpine | ||
|
||
LABEL maintainer="Fábio Assunção <[email protected]>" | ||
|
||
# Install necessary tools | ||
RUN apk --no-cache add \ | ||
bash \ | ||
curl \ | ||
libzip-dev \ | ||
unzip | ||
|
||
# Install php-extension-installer | ||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ | ||
FROM alpine:latest | ||
|
||
WORKDIR /var/www/html/ | ||
|
||
# Essentials | ||
RUN echo "UTC" > /etc/timezone | ||
RUN apk add --no-cache zip unzip curl sqlite bash && \ | ||
sed -i 's/bin\/ash/bin\/bash/g' /etc/passwd | ||
|
||
# Installing PHP | ||
RUN apk add --no-cache php83 \ | ||
php83-common \ | ||
php83-pdo \ | ||
php83-opcache \ | ||
php83-zip \ | ||
php83-phar \ | ||
php83-iconv \ | ||
php83-cli \ | ||
php83-curl \ | ||
php83-openssl \ | ||
php83-mbstring \ | ||
php83-tokenizer \ | ||
php83-fileinfo \ | ||
php83-json \ | ||
php83-xml \ | ||
php83-xmlwriter \ | ||
php83-simplexml \ | ||
php83-dom \ | ||
php83-pdo_mysql \ | ||
php83-pdo_sqlite \ | ||
php83-tokenizer \ | ||
php83-pecl-redis \ | ||
php83-intl \ | ||
php83-exif \ | ||
php83-pcntl \ | ||
php83-sockets | ||
|
||
RUN ln -s /usr/bin/php83 /usr/bin/php | ||
|
||
# Install Composer | ||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer | ||
|
||
# Install required PHP extensions | ||
RUN install-php-extensions pcntl sockets | ||
|
||
# Set the working directory | ||
WORKDIR /var/www | ||
|
||
# Copy application files | ||
COPY . /var/www | ||
|
||
# Download and set up FrankenPHP | ||
ADD https://github.com/dunglas/frankenphp/releases/latest/download/frankenphp-linux-x86_64 /usr/local/bin/frankenphp | ||
RUN chmod +x /usr/local/bin/frankenphp | ||
|
||
# Install Composer dependencies | ||
# Building process | ||
COPY . /var/www/html | ||
|
||
RUN composer install --no-dev | ||
RUN chown -R nobody:nobody /var/www/html/storage | ||
|
||
# Entrypoint command | ||
ENTRYPOINT ["php", "artisan", "octane:start", "--server=frankenphp", "--port=8000", "--workers=16", "--host=0.0.0.0"] | ||
EXPOSE 8000 | ||
ENTRYPOINT ["php", "-d", "variables_order=EGPCS", "artisan", "octane:start", "--server=frankenphp", "--host=0.0.0.0", "--port=8000"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
* text=auto eol=lf | ||
|
||
*.blade.php diff=html | ||
*.css diff=css | ||
*.html diff=html | ||
*.md diff=markdown | ||
*.php diff=php | ||
|
||
/.github export-ignore | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore | ||
.styleci.yml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
/.phpunit.cache | ||
/node_modules | ||
/public/build | ||
/public/hot | ||
/public/build | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env | ||
.env.backup | ||
.env.production | ||
.phpunit.result.cache | ||
docker-compose.override.yml | ||
Homestead.json | ||
Homestead.yaml | ||
auth.json | ||
npm-debug.log | ||
yarn-error.log | ||
/.fleet | ||
/.idea | ||
/.vscode | ||
|
||
/caddy | ||
frankenphp | ||
frankenphp-worker.php | ||
|
||
.docker/volumes/mysql | ||
.docker/volumes/redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
php: | ||
preset: laravel | ||
version: 8 | ||
disabled: | ||
- no_unused_imports | ||
finder: | ||
not-name: | ||
- index.php | ||
- server.php | ||
js: | ||
finder: | ||
not-name: | ||
- webpack.mix.js | ||
css: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MIT License | ||
|
||
Copyright (c) Filament | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
use Filament\Support\Contracts\HasColor; | ||
use Filament\Support\Contracts\HasLabel; | ||
|
||
enum OrderStatus: string implements HasColor, HasLabel | ||
{ | ||
case New = 'new'; | ||
|
||
case Processing = 'processing'; | ||
|
||
case Shipped = 'shipped'; | ||
|
||
case Delivered = 'delivered'; | ||
|
||
case Cancelled = 'cancelled'; | ||
|
||
public function getLabel(): string | ||
{ | ||
return match ($this) { | ||
self::New => 'New', | ||
self::Processing => 'Processing', | ||
self::Shipped => 'Shipped', | ||
self::Delivered => 'Delivered', | ||
self::Cancelled => 'Cancelled', | ||
}; | ||
} | ||
|
||
public function getColor(): string | array | null | ||
{ | ||
return match ($this) { | ||
self::New => 'gray', | ||
self::Processing => 'warning', | ||
self::Shipped, self::Delivered => 'success', | ||
self::Cancelled => 'danger', | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App\Filament\App\Pages; | ||
|
||
use Filament\Forms\Components\TextInput; | ||
use Filament\Forms\Form; | ||
use Filament\Pages\Tenancy\RegisterTenant; | ||
|
||
class RegisterTeam extends RegisterTenant | ||
{ | ||
public static function getLabel(): string | ||
{ | ||
return 'New team'; | ||
} | ||
|
||
public function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
TextInput::make('name')->required(), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\Filament\App\Pages; | ||
|
||
use Filament\Pages\Page; | ||
|
||
class Settings extends Page | ||
{ | ||
protected static ?string $navigationIcon = 'heroicon-o-document-text'; | ||
|
||
protected static string $view = 'filament.app.pages.settings'; | ||
} |
Oops, something went wrong.