Вы находитесь на странице: 1из 70

Laravel Class

About Me
Edi Santoso

Front-End Engineer Lead Kata.ai


1. What you'll learn in this chapter
In every end, there is also a beginning.

➔ PHP Modern
What's new from the PHP programming
language?

➔ Coding Style Guide


Why do other people write code that
we can easily learn?

➔ Modern Framework
Why are other people so fast and
happy to make a website?

➔ Git basic
Modern PHP Development
- Built in server
- Namespace
- Command Line Interface (CLI)
Pro Tip: - Composer
All about the best
practices for PHP
programming, you can
see in PHP the Right
Way.
PHP built in server
Namespace
Coding Style Guide
- PSR-1
- PSR-2
- PSR-4
- Symfony Coding Standards
Modern Framework
- Laravel
- Symfony
- Yii2
- Zend Framework
- Phalcon
Laravel PHP Framework.
The PHP Framework For Web Artisans
2. What you'll learn in this chapter

➔ Installation

➔ Artisan Console

➔ Routing

➔ Configuration

➔ Maintenance mode
Installation
Folder permissions for Linux users
Artisan Console
Routing
Routing
Environment variable type
Determining current environment
Accessing configuration value
Maintenance mode
Pro Tip:
Make folder called
Repositories to drop all
your code folder

Git
Git convention messages
Git flow
3. What you'll learn in this chapter

➔ Controllers

◆ Resource controllers

◆ API Resource controllers

➔ Views

◆ Blade templating

◆ Partial page
Resource Controllers
Resource Controllers
Resource Controllers
Resource Controllers
API Resource
Method Injection
Passing data to view
Passing data to view
Defining layout
Extending the layout
Loading & render assets
Calling another page on views
4. What you'll learn in this chapter

➔ Model

◆ Migrations table

◆ Table seeder

◆ Model Factories
Generating Model
Model Convention
Model attributes - Table name
Model attributes - Primary keys
Model attributes - Incrementing
Model attributes - Timestamps
Model attributes - Date format
Model attributes - Custom columns
Model attributes - Default values
Model attributes - Custom connection
Problem - Specified key was too long error
Solving
5. What you'll learn in this chapter

➔ Migrations

◆ Generating migration

◆ Migration structure

◆ Migration commands

◆ Creating tables & columns

◆ Modifying columns
Migration - generating migrations
Migration - Structure
Migration - Running migration
Pro Tip:
Please see all Available
Column Types
https://laravel.com/docs/
5.8/migrations#columns

Migration - Creating tables & columns


Pro Tip:
Don’t edit existing
migrations structure,
always create a new
migration file when
modifying or add columns.

Migration - Modifying columns


6. What you'll learn in this chapter

➔ Seeders

◆ Generating seeder

◆ Seeder Structure

◆ Generating Model Factory

◆ Model Factory

◆ Running Seeder
Seeder - Running seeder
Seeder - Structure
Seeder - Using Model factory
Pro Tip:
You can generate data
using Faker generator
https://github.com/fzanin
otto/Faker

Seeder - Using Model factory


Seeder - Calling class seeder
Seeder - Running Seeder
7. What you'll learn in this chapter

➔ Forms

◆ Folders Structure

◆ Render partial page


Forms - Folder Structures
Forms - CRSF field
Forms - Method field
Forms - Validation errors
Forms - Including sub-view
Forms - Including sub-view
Forms - Control structure
Good luck!
“The more problems you
encounter, the stronger you
will be.”

Вам также может понравиться