{"id":20127774,"url":"https://github.com/davidcardoso/codeflix-api","last_synced_at":"2026-05-08T22:03:39.868Z","repository":{"id":238017061,"uuid":"114949076","full_name":"DavidCardoso/codeflix-api","owner":"DavidCardoso","description":"[Learning case] API Restful built with Laravel PHP Framework for the app CodeFlix.","archived":false,"fork":false,"pushed_at":"2018-06-05T22:14:56.000Z","size":6165,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T08:25:09.243Z","etag":null,"topics":["api","laravel","netflix","php","restful-api"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidCardoso.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-12-21T01:41:58.000Z","updated_at":"2018-06-05T22:14:58.000Z","dependencies_parsed_at":"2024-05-03T21:45:29.347Z","dependency_job_id":"164bdc48-10ae-4203-bc2c-540f0a5511b6","html_url":"https://github.com/DavidCardoso/codeflix-api","commit_stats":null,"previous_names":["davidcardoso/codeflix-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fcodeflix-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fcodeflix-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fcodeflix-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fcodeflix-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidCardoso","download_url":"https://codeload.github.com/DavidCardoso/codeflix-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241572175,"owners_count":19984230,"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":["api","laravel","netflix","php","restful-api"],"created_at":"2024-11-13T20:23:44.537Z","updated_at":"2026-05-08T22:03:39.820Z","avatar_url":"https://github.com/DavidCardoso.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://laravel.com/assets/img/components/logo-laravel.svg\"\u003e\n\u003c/p\u003e\n\n# Notes about patterns used on this project\n\n## Authentication\n- client: app\\Http\\Controllers\\Auth\n- admin: app\\Http\\Controllers\\Admin\\Auth\n\n## IDE auto-complete\n- barryvdh/laravel-ide-helper + artisan\n- doctrine/dbal + artisan\n\n## Email\n- mailtrap.io =\u003e SMTP faker\n- AWS SES =\u003e SMTP\n\n## View\n- patricktalmadge/bootstrapper:5.10.* + service provider + facade\n- kris/laravel-form-builder:1.11 + service provider + facade\n\n## Routes\n- Route::resource('users', 'UsersController');\n- Routes Model Binding =\u003e route argument equal to the one from the action\n\n## NavBar\n- $navbar = Navbar::withBrand(config('app.name'), route('admin.dashboard'))-\u003einverse();\n- $menusLeft = Navigation::links($arrayLinksLeft);\n- $menusRight = Navigation::links($arrayLinksRight)-\u003eright();\n- $formLogout = FormBuilder::plain([]);\n\n## CRUD User\n- php artisan make:controller \"Admin\\UsersController\" --resource --model=\"CodeFlix\\Models\\User\"\n- php artisan make:form \"Forms\\UserForm\" --fields=\"name:text, email:email\"\n\n## Design Pattern:\n- Repositories are services from access layer and integration  with the databases entities\n- prettus/l5-repository:2.6.27 + service provider\n- php artisan vendor:publish --provider=\"Prettus\\Repository\\Providers\\RepositoryServiceProvider\"\n\n## Refactoring CRUD User using L5-Repository\n- rename _User.php_ to _User_old.php_\n- php artisan make:repository User\n- delete new _User.php_ and rename again _User_old.php_ to _User.php_\n- delete new migration of User model\n- In register() method on _RepositoryServiceProvider.php_: \n\t- $this-\u003eapp-\u003ebind(UserRepository::class, UserRepositoryEloquent::class);\n\n## User Verification\n- jrean/laravel-user-verification:4.1.2 + service provider + facade\n- php artisan vendor:publish --provider=\"Jrean\\UserVerification\\UserVerificationServiceProvider\" --tag=migrations\n- edit namespace of the user model on the new migration\n- php artisan vendor:publish --provider=\"Jrean\\UserVerification\\UserVerificationServiceProvider\" --tag=config\n- php artisan migrate\n- adjust user admin data migration to be verified by default\n- add route middleware **IsVerified::class** on _app\\Http\\Kernel.php_\n- add middleware **isVerified** on admin group routes\n- php artisan vendor:publish --provider=\"Jrean\\UserVerification\\UserVerificationServiceProvider\" --tag=views\n- php artisan make:controller EmailVerificationController\n- add EmailVerification routes on _routes/web.php_\n- edit EmailVerification views\n- create _resources/lang/\u003cyour-lang\u003e/user-verification.php_\n\n## User settings\n- php artisan make:controller \"Admin\\Auth\\UserSettingsController\" --resource\n\t- implements edit and update actions\n- add routes on _routes\\web.php_\n\t- Route::get('users/settings', 'Auth\\UserSettingsController@edit')-\u003ename('user-settings.edit');\n    - Route::put('users/settings', 'Auth\\UserSettingsController@update')-\u003ename('user-settings.update');\n- refactor **redirectAfterVerification()** action of **EmailVerificationController** to redirect to route('admin.user-settings.edit')\n- php artisan make:form \"Forms\\UserSettingsForm\" --fields=\"password:password, password_confirmation:password\"\n- create _resources/views/admin/auth/setting.blade.php_\n- add new menu option on _resources/views/layouts/admin.blade.php_\n- files used\n\t- new:   \n\t\t- app/Http/Controllers/Admin/Auth/UserSettingsController.php\n\t\t- app/Forms/UserSettingsForm.php\n\t\t- resources/views/admin/auth/setting.blade.php\n\t- modified:\n\t\t- app/Http/Controllers/EmailVerificationController.php\n\t\t- app/Repositories/UserRepositoryEloquent.php\n\t\t- resources/views/shared/navbar.blade.php\n\t\t- routes/web.php\n\n## CRUD Category using L5-Repository with full options\n- php artisan make:entity Category\n\t- Presenter: no\n\t- Validator: no\n\t- Controller: yes\n- files used\n\t- modified:\n\t\t- config/app.php\n\t- new:\n\t\t- app/Http/Controllers/CategoriesController.php\n\t\t- app/Http/Requests/\n\t\t- app/Models/Category.php\n\t\t- app/Providers/RepositoryServiceProvider.php\n\t\t- app/Repositories/\n\t\t- database/migrations/2017_11_12_204552_create_categories_table.php\n\n## CRUD Category using L5-Repository with minimal options\n- php artisan make:repository Category\n\n## CRUD Serie\n- php artisan make:repository Serie\n- php artisan make:controller \"Admin\\SeriesController\" --resource --model=\"CodeFlix\\Models\\Serie\"\n- php artisan make:seeder \"SeriesTableSeeder\"\n- php artisan make:form \"Forms\\SerieForm\" --fields=\"title:text, description:textarea\"\n- php artisan migrate:refresh --seed\n\n## CRUD Video\n- php artisan make:repository Video\n- php artisan make:form \"Forms\\VideoForm\" --fields=\"title:text, description:textarea\"\n- php artisan make:controller \"Admin\\VideosController\" --resource --model=\"CodeFlix\\Models\\Video\"\n    - In _VideosController_: implement all actions\n    - In _web.php_ routes: add videos resources routes\n- php artisan make:seeder VideosTableSeeder\n    - In _VideosTableSeeder_: $video-\u003eserie()-\u003eassociate($serie);\n    - php artisan migrate:refresh --seed\n- In _Videos.php_ model: set $fillable and implement TableInterface methods\n- php artisan make:migration create_category_video_table --create=category_video\n    - php artisan migrate\n    - In _VideosTableSeeder_: $video-\u003ecategories()-\u003eattach($categories-\u003erandom(4)-\u003epluck('id'));\n    - php artisan migrate:refresh --seed\n- In _resources/views/admin/videos_: create and implement views\n    - to manage videos using tabs, use blade component and slot\n- php artisan make:controller \"Admin\\VideoRelationsController\" --resource --model=\"CodeFlix\\Models\\Video\"\n    - In _VideoRelationsController_: implement create and store actions\n    - In _web.php_ routes: add videos relations routes\n- php artisan make:form \"Forms\\VideoRelationForm\"\n\n## Refactor CRUD Serie\n- handling thumb/image upload/download\n    - mkdir -p app/Media\n    - create trait _MediaStorages.php_\n    - create trait _SeriePaths.php_\n    - create trait _ThumbUploads.php_\n    - refactor _SerieTableSeeder.php_ to upload thumb and update the model\n    - requirements\n        - composer require folklore/image:0.3.20\n        - apt update \u0026\u0026 apt install php-gmagick # use 'gd' or 'imagick' alternatively\n        - add Facade 'Image' =\u003e \\Folklore\\Image\\Facades\\Image::class\n        - add Provider Folklore\\Image\\ImageServiceProvider::class\n        - php artisan vendor:publish --provider=\"Folklore\\Image\\ImageServiceProvider\"\n    - refactor _Serie.php_, _SeriesController.php_, _SeriePaths.php_, _SerieRepositoryEloquent.php_\n    - refactor _web.php_\n    - refactor _SerieForm.php_, _admin/series/index.blade.php_\n    - refactor _ThumbUploads.php_\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcardoso%2Fcodeflix-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidcardoso%2Fcodeflix-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcardoso%2Fcodeflix-api/lists"}