{"id":25016694,"url":"https://github.com/meedeley/deep_talk_about_relationship","last_synced_at":"2025-03-30T07:43:15.592Z","repository":{"id":273242871,"uuid":"919081593","full_name":"meedeley/deep_talk_about_relationship","owner":"meedeley","description":"learn laravel about relationship","archived":false,"fork":false,"pushed_at":"2025-02-04T18:28:54.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T19:35:45.042Z","etag":null,"topics":["intermediate-projects","laravel","pivot-tables"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meedeley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-19T16:58:03.000Z","updated_at":"2025-02-04T18:28:58.000Z","dependencies_parsed_at":"2025-01-19T18:34:10.491Z","dependency_job_id":"ce358533-6937-4c13-a6d1-531d6987e47c","html_url":"https://github.com/meedeley/deep_talk_about_relationship","commit_stats":null,"previous_names":["meedeley/deep_talk_about_relationship"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meedeley%2Fdeep_talk_about_relationship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meedeley%2Fdeep_talk_about_relationship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meedeley%2Fdeep_talk_about_relationship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meedeley%2Fdeep_talk_about_relationship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meedeley","download_url":"https://codeload.github.com/meedeley/deep_talk_about_relationship/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246290580,"owners_count":20753724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["intermediate-projects","laravel","pivot-tables"],"created_at":"2025-02-05T09:54:09.477Z","updated_at":"2025-03-30T07:43:15.572Z","avatar_url":"https://github.com/meedeley.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ngulik Laravel\n\n1. With - Digunakan untuk eager loading relasi sebelum query dijalankan, cocok jika relasi sudah pasti diperlukan sejak awal untuk mencegah N+1 query dan meningkatkan efisiensi.\n2. Load - Digunakan untuk eager loading relasi setelah query dijalankan, berguna jika kebutuhan meload relasi baru diputuskan setelah data utama diambil.\n3. Pluck - Mengambil semua nilai dari satu kolom dalam tabel.\n4. Find - Mencari Id Table\n5. Cookie - Data Simpan Disisi Client\n6. Session - Data Disimpan Disisi Server\n7. toJson - Mengubah data menjadi format JSON string.\n8. toArray - Mengubah data menjadi format array PHP.\n9. json_encode - Mengubah data PHP (array atau objek) menjadi string JSON.\n10. json_decode -  Mengubah string JSON menjadi data PHP (array atau objek). \n\n## Mempelajari Relasi One To One\n\n    ```\n    - Migrations Sellers\n    Schema::create('sellers', function (Blueprint $table) {\n            $table-\u003eid();\n            $table-\u003estring('name');\n            $table-\u003etimestamps();\n        });\n    ```\n\n    ```\n    - Migration Cities\n      Schema::create('cities', function (Blueprint $table) {\n            $table-\u003eid();\n            $table-\u003eforeignId('seller_id')-\u003eunique()-\u003econstrained();\n            $table-\u003estring('name');\n            $table-\u003etimestamps();\n        });\n    ```\n\n    ```\n    - Relasi Model Seller\n    Class Seller extends Model {\n        ...\n        public function city(): HasOne\n        {\n            return $this-\u003ehasOne(City::class, 'seller_id', 'id');\n        }\n    }\n    ```\n\n    ```\n    - Relasi Model City\n    Class City extends Models {\n        ...\n        public function seller(): BelongsTo\n        {\n            return $this-\u003ebelongsTo(Seller::class, 'seller_id', 'id');\n        }\n    } \n    ```\n## Mempelajari Relasi One To Many\n\n## Mempelajari Relasi Many To Many\n\n### Intermediate Table\n\n### Pivot Table\n\n### Attach\n\n### Detach\n\n### Sync\n\n### UpdateExistingPivot\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeedeley%2Fdeep_talk_about_relationship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeedeley%2Fdeep_talk_about_relationship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeedeley%2Fdeep_talk_about_relationship/lists"}