{"id":24333365,"url":"https://github.com/ericgitangu/php_lavaral_fundamentals","last_synced_at":"2025-06-18T16:37:53.775Z","repository":{"id":260293767,"uuid":"880875925","full_name":"ericgitangu/php_lavaral_fundamentals","owner":"ericgitangu","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-22T04:03:10.000Z","size":489,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T11:24:12.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ericgitangu.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,"zenodo":null}},"created_at":"2024-10-30T14:21:46.000Z","updated_at":"2024-10-31T22:02:27.000Z","dependencies_parsed_at":"2025-03-11T13:47:39.998Z","dependency_job_id":"eab85c01-6134-44fb-81bb-568d5946f0b9","html_url":"https://github.com/ericgitangu/php_lavaral_fundamentals","commit_stats":null,"previous_names":["ericgitangu/php_lavaral_fundamentals"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericgitangu/php_lavaral_fundamentals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgitangu%2Fphp_lavaral_fundamentals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgitangu%2Fphp_lavaral_fundamentals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgitangu%2Fphp_lavaral_fundamentals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgitangu%2Fphp_lavaral_fundamentals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericgitangu","download_url":"https://codeload.github.com/ericgitangu/php_lavaral_fundamentals/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgitangu%2Fphp_lavaral_fundamentals/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260590438,"owners_count":23033060,"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":[],"created_at":"2025-01-18T03:15:16.689Z","updated_at":"2025-06-18T16:37:47.711Z","avatar_url":"https://github.com/ericgitangu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Interview Prep Repository\n\n![MIT License](https://img.shields.io/badge/license-MIT-green)\n![Laravel Repo](https://img.shields.io/badge/Laravel-Repo-blue)\n\nWelcome to the **Laravel Interview Prep Repository**! This repository is structured to help you understand and practice essential Laravel concepts in preparation for technical interviews. It includes examples, best practices, and explanations for core concepts and implementations in Laravel.\n\n## Table of Contents\n- [Overview](#overview)\n- [Getting Started](#getting-started)\n  - [Fork This Repository](#fork-this-repository)\n  - [Installation](#installation)\n- [Core Laravel Concepts](#core-laravel-concepts)\n  - [Project Structure](#project-structure)\n  - [Routing](#routing)\n  - [Middleware](#middleware)\n  - [Controllers and Resource Controllers](#controllers-and-resource-controllers)\n  - [Blade Templating](#blade-templating)\n  - [Models and Eloquent ORM](#models-and-eloquent-orm)\n  - [Validation](#validation)\n  - [Service Providers](#service-providers)\n- [License](#license)\n\n---\n\n## Overview\n\nThis repository is designed to provide in-depth examples of **Laravel’s most important concepts**. Each concept is implemented as a separate example in the repository to make it easy to understand and apply in real-world situations. The repository assumes some familiarity with PHP but provides detailed explanations where needed.\n\n### Project Goals\n- **Prepare for Laravel interviews** by practicing core concepts.\n- **Understand best practices** in building secure, scalable applications with Laravel.\n- **Enhance PHP OOP knowledge** through Laravel’s object-oriented features.\n\n---\n\n## Getting Started\n\nTo start using this repo, **fork it**, clone it, and install the necessary dependencies.\n\n### Fork This Repository\n1. **Fork** the repository by clicking the “Fork” button at the top of this page.\n2. Clone your forked repository locally:\n   ```bash\n   git clone https://github.com/YOUR_USERNAME/laravel-interview-prep.git\n   cd laravel-interview-prep\n\n### Installation\nInstall dependencies using Composer:\n\n```bash\n    composer install\n```    \nCopy the .env.example file to .env and generate an application key:\n\n```bash\n    cp .env.example .env\n    php artisan key:generate\n```\n**Run migrations**:\n\n```bash\n    php artisan migrate\n```\n\n**Start the development server**\n\n```bash\n    php artisan serve\n```\n\n### Core Laravel Concepts\nThis section contains details on core Laravel concepts with examples included in this repository to help you gain a deeper understanding of each area. These concepts are divided by sections and structured in the repo for easy navigation.\n\n1. **Project Structure**\nLaravel’s directory structure is organized by core functionality, which makes it easy to navigate and manage even large applications. In this repo:\n\napp/ - Core application code, including Models, Controllers, and Services.\nroutes/ - Application routes are defined here. web.php contains web routes, while api.php contains routes for API.\nresources/views/ - Contains Blade templating files.\n\n2. **Routing**\nRouting in Laravel defines how URLs map to controller actions. This repo includes:\n\n**Basic routes using closures**.\nRoute groups for grouping related routes with common attributes.\nRoute model binding to automatically inject model instances.\n\nExample:\n\n```php\n    // Basic route\n    Route::get('/home', [HomeController::class, 'index']);\n\n    // Route model binding\n    Route::get('/user/{user}', [UserController::class, 'show']);\n```\n\n3. **Middleware**\nMiddleware in Laravel provides a way to filter HTTP requests entering your application. In this repo, we’ve used middleware for:\n\n3.1 **Authentication (using auth middleware)**.\nCustom middleware for logging request data.\n\nExample:\n\n```bash\n    php artisan make:middleware CheckUserRole\n```\n\n// Register in kernel\nprotected $routeMiddleware = [\n    'role' =\u003e \\App\\Http\\Middleware\\CheckUserRole::class,\n];\n\n4. **Controllers and Resource Controllers**\nControllers in Laravel help organize application logic. This repo demonstrates:\n\nBasic controllers for handling user requests.\nResource controllers with RESTful actions for CRUD operations.\n\nExample:\n\n```bash\n    // Resource controller\n    php artisan make:controller ProductController --resource\n```\n\n// Route\nRoute::resource('products', ProductController::class);\n\n\n5. **Blade Templating**\nBlade is Laravel's powerful templating engine. This repo covers:\n\nLayout inheritance using @extends, @section, and @yield.\nBlade components to create reusable UI components.\nExample:\n\n```html\n    \u003c!-- Layout file Using Blade--\u003e\n    \u003c!DOCTYPE html\u003e\n    \u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003e@yield('title')\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        @yield('content')\n    \u003c/body\u003e\n    \u003c/html\u003e\n\n    \u003c!-- View file --\u003e\n    @extends('layouts.app')\n    @section('title', 'Home')\n    @section('content')\n        \u003ch1\u003eWelcome to Home\u003c/h1\u003e\n    @endsection\n```\n6. **Models and Eloquent ORM**\nEloquent, Laravel’s ORM, is used for database interaction. In this repo:\n\nDefining models and relationships (e.g., one-to-many, many-to-many).\nEloquent queries for CRUD operations.\nExample:\n\n```php\n    // One-to-many relationship\n    class User extends Model {\n        public function posts() {\n            return $this-\u003ehasMany(Post::class);\n        }\n    }\n```\n7. **Validation**\nLaravel provides a simple way to validate incoming HTTP requests. This repo covers:\n\nRequest validation using FormRequest.\nCustom validation rules for more complex requirements.\nExample:\n\n```php\n    // Request validation\n    $request-\u003evalidate([\n        'title' =\u003e 'required|string|max:255',\n        'content' =\u003e 'required'\n    ]);\n```\n8. **Service Providers**\nService Providers in Laravel are used for bootstrapping services. In this repo, service providers are used to:\n\nRegister services like payment or logging services.\nCustomize application bootstrapping by registering custom components.\n\nExample:\n\n```php\n    // Register in AppServiceProvider\n    public function register() {\n        $this-\u003eapp-\u003esingleton(MyService::class, function ($app) {\n            return new MyService();\n        });\n    }\n```\n## License\n\nThis project is open-sourced under the **MIT License**.\n\n---\n\n## Contributing\n\nContributions are welcome! If you’d like to improve the examples or add new concepts to this repository, please follow these steps:\n\n1. **Fork** the repository.\n2. **Clone** your forked repository locally:\n```bash\n    git clone https://github.com/YOUR_USERNAME/laravel-interview-prep.git\n    cd laravel-interview-prep\n ```\n3. Create a new branch for your changes:\n```bash\n    git checkout -b feature/new-concept\n```\n4. Make your updates and commit:\n```bash\n    git add .\n    git commit -m \"Add new concept: [describe the concept]\"\n```\n5. Push your changes:\n```bash\n    git push origin feature/new-concept\n```\n6. Open a Pull Request on the original repository.\n\n**Contact**\nFor any questions, please reach out to the repository maintainer.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgitangu%2Fphp_lavaral_fundamentals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericgitangu%2Fphp_lavaral_fundamentals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgitangu%2Fphp_lavaral_fundamentals/lists"}