cron php laravel UI Boostrap jetstream docker-compose
laravel_docker
dokcer-compose.yml
cron: build: ./infra/docker/cron env_file: ./env.mariadb.local.env stop_signal: SIGTERM depends_on: - app volumes: - ./backend:/work/backend Dockerfile
FROM php:8.0.11-fpm-buster LABEL maintainer="ucan-lab <yes@u-can.pro>" #SHELL ["/bin/bash", "-oeux", "pipefail", "-c"] # timezone environment ENV TZ=Asia/Taipei \ # locale LANG=en_US.UTF-8 \ LANGUAGE=en_US:UTF-8 \ LC_ALL=en_US.UTF-8 \ # Laravel environment APP_SERVICES_CACHE=/tmp/cache/services.php \ APP_PACKAGES_CACHE=/tmp/cache/packages.php \ APP_CONFIG_CACHE=/tmp/cache/config.php \ APP_ROUTES_CACHE=/tmp/cache/routes.php \ APP_EVENTS_CACHE=/tmp/cache/events.php \ VIEW_COMPILED_PATH=/tmp/cache/views \ # SESSION_DRIVER=cookie \ LOG_CHANNEL=stderr \ DB_CONNECTION=mysql \ DB_PORT=3306 RUN apt-get update RUN apt-get -y install locales libicu-dev libzip-dev htop cron nano RUN apt-get -y install default-mysql-client RUN locale-gen en_US.
https://blog.trippyboy.com/2021/laravel/laravel-expected-response-code-250-but-got-an-empty-response/
./config/mail.php 'local_domain' => env('MAIL_HOST'), 'default' => env('MAIL_MAILER', 'smtp'), 'mailers' => [ 'smtp' => [ 'transport' => 'smtp', 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'port' => env('MAIL_PORT', 587), 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, 'auth_mode' => null, 'local_domain' => env('MAIL_HOST'), ],
Multiple parts (id, name, finish, finish_noe)
finish = 2 is Job OK
protected $rules = [ 'parts.*.finish_note' => ['required_if:parts.*.finish,2'], ]
Http/Kernel.php
.env .env-local.env .env-staging.env .env-production.env
class Kernel extends HttpKernel { public function __construct(Application $app, Router $router) { parent::__construct($app, $router); $environmentPath = __DIR__.'/../../'; $dotenv = Dotenv::createUnsafeImmutable($environmentPath, '.env'); // getenv not thread safe $dotenv->safeLoad(); //this is important $dotenv = Dotenv::createUnsafeImmutable($environmentPath, '.env.'.getenv('APP_ENV').'.env'); // getenv not thread safe $dotenv->safeLoad(); //this is important } .env```
APP_ENV=local
LOG_CHANNEL=stack
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
.env.local.env``` APP_NAME=OOXX_Local APP_KEY=base64:NDvP.........g= APP_DEBUG=true APP_URL=http://localhost QUERY_DETECTOR_ENABLED=true DB_CONNECTION=mysql DB_HOST=127.
When you use some model ->paginate
Get Illuminate\Pagination\LengthAwarePaginator But Value Don’t Back To Variable.
$orders->paginate(10) $orders = $orders->paginate(10) So $this->orders->paginate(10) $this->oorders = $this->oorders->paginate(10)
Get livewire public variable
Front web Try to get public $order```
document.addEventListener(‘livewire:load’, function () {
console.log(@this.order);
livewire window.livewire.find eloquent collection https://github.com/livewire/livewire/issues/1641?fbclid=IwAR0uHylkj-1vg8p5jUoBgPYfuAYsWnBhgp6EK2bJcBce8ze-tdtAa8ElLNY#issuecomment-736146468 Eloquent Collection data won't be made available to the front end unless you have the collection properties specified in the $rules array as the contents are models, so the same conditions apply to it as apply to just a single model property. This is for security reasons so the whole collection and all properties aren't just sent to the front end.
18 Tips to Optimize Your Laravel Database Queries | Laravel News (laravel-news.com)