Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introduction to Laravel framework (1) (@Malang ...
Search
DOT Indonesia
January 26, 2018
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to Laravel framework (1) (@Malang PHP User Group Meetup - October 2017)
DOT Indonesia
January 26, 2018
More Decks by DOT Indonesia
See All by DOT Indonesia
Agile Testing To Support Short Cycle Development (@DOT TechTalk, 18 Januari 2019)
dotindonesia
0
130
How to be Agile (@DOT TechTalk, 11 Januari 2019)
dotindonesia
1
64
Build an Awesome CI/CD with Jenkins - Samsul (@PHP User Group Meetup, 17 September 2018)
dotindonesia
0
150
Mockup API to IMPROVE Team Collaboration - Toni (@DOT TechTalk, 10 Agustus 2018)
dotindonesia
0
99
Investment & Financing - Arya (@DOT TechTalk, 20 April 2018)
dotindonesia
3
83
Introduction to Docker Container - Samsul Ma'arif (@DILO Malang - 12 March 2018)
dotindonesia
0
190
Company Overview - DOT Indonesia (@Study Excursie UNIDA Gontor - March 2018)
dotindonesia
0
140
How to be a Great Mobile Developer - Agus (@Study Excursie UNIDA Gontor - March 2018)
dotindonesia
0
78
Rapid mobile development with React Native - Fahmi (@Study Excursie UNIDA Gontor - March 2018)
dotindonesia
0
63
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
So, you think you're a good person
axbom
PRO
2
2.2k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Un-Boring Meetings
codingconduct
0
420
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
360
Transcript
Introduction to Laravel framework “Love beautiful code? We do too.”
At Malang PHP User Group Meetup - October 2017
About Speaker Ahmad Fatoni [
[email protected]
] Web Developer at DOT Indonesia
(PT Distinction On Technology Indonesia)
Laravel (2011 ) V5.5 (2017 ) Taylor Otwell Laravel Horizon
| Laravel Dusk | Laravel Echo | Valet | Lumen | and more….
Today Topic Architecture Routing Controller Model Views Migration Query Builder
Eloquent Composer support
Architecture
Architecture
Routing Default route files : routes/web.php and routes/api.php Available method
: GET, POST, PUT, PATCH, DELETE, OPTIONS CSRF protection Using parameter(s) : Route::get('users/{id}', ['uses' => 'UserController@show]); Named route : Route::get('users/{id}', ['uses' =>UserController@show])->name(‘show’); Grouping
Controller Default folder : app/Http/Controllers Connecting model and view (see
the architecture) ‘Request’ handler : Illuminate\Http\Request ◦ all() ◦ only() ◦ except() ◦ json() ◦ And more (https://laravel.com/api/5.5/Illuminate/Http/Request.html)
Controller
Controller Return view response : return view('auth.login'); Compacting data to
view $data['member'] = [ 'fatoni', 'kennan' ]; return view('member.index', compact('data')); Redirect to route : return redirect()->route('member.index');
Model Default folder : app Connecting app with database Awesome
Eloquent
Model
Views Default folder : resources/views Blade templating (https://laravel.com/docs/5.5/blade)
Views Easy to organizing
Views Easy to organizing
Migrations Default folder : database/migrations Build database from application Easily
modify and share database schema Creating foreign key (relationship)
Migrations CreateRolesTable CreatePermissionRoleTable
Migrations
Query Builder Get Data Query Builder : ◦ $users =
DB::table('users')->get(); SQL Query ◦ $sql = "SELECT * FROM users”; Insert Data Query Builder : ◦ $result = DB::table('users')->insert([‘colum1’ => ‘values1’, ‘column2’ => ‘values2’]); ◦ $result = DB::table(users’)->insert($request->all()); SQL Query ◦ INSERT INTO users (column1, column2.) VALUES (value1, value2)
Query Builder Update Data Query Builder : ◦ $result =
DB::table('users')->where(‘id’, ‘=’, 1)->update([‘colum1’ => ‘values1’, ‘column2’ => ‘values2’]); ◦ $result = DB::table(users’)->where(‘id’, ‘=’, 1)->insert($request->all()); SQL Query ◦ UPDATE users SET column1=value, column2=value2 WHERE id=1
Eloquent Awesome collections ( all(), create(), update(), etc ) Accessors
& Mutators Easy managing and working with relationships Serializations
Eloquent Awesome collections ( all(), create(), update(), etc )
Eloquent Accessors & Mutators Accessor Mutator
Eloquent Easy managing and working with relationships ◦ One To
One ◦ One To Many ◦ Many To Many ◦ Has Many Through ◦ Polymorphic Relations ◦ Many To Many Polymorphic Relations
Eloquent Easy managing and working with relationships ◦ One To
One Call it : $phone = User::find(1)->phone;
Eloquent Serializations ◦ Serializing To Arrays ◦ Serializing To JSON
Composer support
None