composer require inertiajs/inertia-laravel
Setup Middleware
php artisan inertia:middleware
| -- Motmaina Localization Table SQL Migration (Complete & Cleaned) | |
| -- Fully translated English & Arabic without any _en / _ar placeholders | |
| -- Idempotent: INSERT if Key does not exist, and UPDATE if Key already exists. | |
| SET NAMES utf8mb4; | |
| INSERT INTO `localization` (`Key`, `String_en`, `String_ar`, `Created_at`) | |
| SELECT '2', 'Password', 'كلمة المرور', '2020-04-20 04:14:30' | |
| WHERE NOT EXISTS (SELECT 1 FROM `localization` WHERE `Key` = '2'); | |
| UPDATE `localization` |
| -- Localization table data export | |
| -- Idempotent: only inserts if Key does not already exist | |
| SET NAMES utf8mb4; | |
| INSERT INTO `localization` (`Key`, `String_en`, `String_ar`, `Created_at`) | |
| SELECT '2', 'Password', 'كلمة المرور', '2020-04-20 04:14:30' | |
| WHERE NOT EXISTS (SELECT 1 FROM `localization` WHERE `Key` = '2'); | |
| INSERT INTO `localization` (`Key`, `String_en`, `String_ar`, `Created_at`) |
| # ✅ The superior approach | |
| version: '3.8' | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - ./.temp/postgres:/var/lib/postgresql/data | |
| environment: |
| # ❌ The traditional (problematic) way | |
| version: '3.8' | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data # Where is this exactly? | |
| environment: | |
| POSTGRES_DB: myapp | |
| POSTGRES_USER: admin |
| <?php | |
| namespace App\Traits; | |
| trait LivewireMedia | |
| { | |
| public function addMediaTo($media, $collectionName) | |
| { | |
| $this->addMedia($media->getRealPath()) | |
| ->usingName(pathinfo($media->getClientOriginalName(), PATHINFO_BASENAME)) |
| const FunctionalComponent = () => { | |
| React.useEffect(() => { | |
| return () => { | |
| console.log("dadaaaah"); | |
| }; | |
| }, []); | |
| return <h1>Selamat tinggal</h1>; | |
| }; |