wiki

Personal Knowledge Base by Bart den Hoed

View project on GitHub

Wiki - Development - Laravel

development laravel

Introduction

Table of contents

General documentation

Directoy Structure

  • Directory Structure
    .
    +-- app
    |   +-- Http
    |   |   +-- Controllers
    |   |   |   +-- Controller.php
    |   |   +-- Middleware
    |   |       +-- VerifyCsrfToken.php
    |   +-- [Model].php
    |
    +-- database
    |   +-- migrations
    |       +-- date_filename.php
    |
    +-- public
    |   +-- css
    |   |   +-- app.css
    |   +-- js
    |   |   +-- app.js
    |   +-- index.php
    |
    +-- recourses
    |   +-- js
    |   +-- sass
    |   +-- views
    |       +-- welcome.blade.php
    |
    +-- routes
    |   +-- web.php
    

Starting

  1. Create new project laravel new [projectname]
  2. Edit the .env. file

Routing

CRUD

  • GET /projects -> index (all projects)
  • GET /projects/1 -> show (1 project)
  • GET /projects/create -> create (create form)
  • POST /projects -> store (insert project)
  • GET /projects/1/edit -> edit (edit project)
  • PATCH /projects/1 -> update (update project)
  • DELETE /projects/1 -> destory (delete project)

Artisan

  • Create controller: php artisan make:controller [-r] [ControllerName] [-m] [Model]
  • Create migration: php artisan make:migration [create_example_table]
  • Create model: php artisan make:model [Name]
  • Maintenance Mode: php artisan down

    Tinker

  • php artisan tinker

    Migrations

    Database version control.

  • php artisan migrate install
  • php artisan migrate:rollback
  • Drop all tables: php artisan migrate:fresh

Tutorials

Laracasts

Defenition

  • Todo: 🕐
  • Doing: ⌛
  • Done: ✅

Samples

  • https://github.com/jivanrij/laravel-samples

Laracon 2021

  • https://onramp.dev/

Diving the Queue

  • Single Jobs
  • Chain Jobs (https://laravel.com/docs/master/queues#job-chaining)
  • Batch Jobs ()

The final Laravel Service Container talk

Routing Laravel

Laravel Update

Understanding Laravel broadcasting

Understanding Foundation: What ties everything together

Doing small things with Livewire & Alphine

Laravel’s Artisan Console component