Download presentation
Presentation is loading. Please wait.
Published byEvangeline Summers Modified over 8 years ago
1
Under the hood of a small laravel app Speaker: George Drakakis Github project: https://github.com/drakakisgeo/payme
2
You can find me on twitter @lollypopgr || the laravel.gr forum A bit about me. A full-stack developer with a Graphic Design & multimedia background, freelancing from 2003, located in Athens – Greece. Currently working on www.billit.io (L4 L5) www.fantasytravelofgreece.com (Drupal 7 + Laravel 5) www.clicknsend.gr (PHP 4 crap to L5) Also… Laravel.gr community administrator and Co- Organizer of Athens Meetup. Big fan of Arts and Culture. Co-founder of artmagazine.gr and e.t.c. …soon I’ll be a Dad thing.
3
Important note a lot of code will follow …so let me tell you a few things about the code first.
4
The OCP app What the heck is that thing in the first place? 1
5
The general OCP logic Your client Fills a form You create a payment Link. You are paid.
6
In more detail Admin panel You create a link Your client visit the payment form through the link Payment gateway validate & collects payment Client fills in the payment form Money are transferred to your bank + add on Invoicing SEND Transaction info to Email / Slack
7
Task list 1.Create an administrator panel for the links 2.Create a payment form 3.Email alert and push notifications to slack 4.Translatable layout and easy customization 5.Flexible coding style, so payment gateways can be swapped in the future. 6.Integration Testing of the app 7.Deployment setup
8
The absolute basics MVC pattern / Routing / Middleware /.env setup
9
MVC Model View Controller (MVC) is a method that help us separate the core of our application from the graphics (View) and the Data (Model).
10
ROOTING Routing is the process of taking a URI endpoint and decomposing it into parameters to determine which module, controller, and action of that controller should receive the request.
11
MIDDLEWARE HTTP middleware provide a convenient mechanism for filtering HTTP requests entering your application. For example, Laravel includes a middleware that verifies the user of your application is authenticated.
12
.env Application variables per environment + protect private data like Api keys and credentials from GIT repositories
13
Routing ( app/Http/routes.php )
16
Routing ( app/Http/adminRoutes.php )
17
Database Migrations We need to create the database tables first. 2
18
Migration Example I
19
Migration Example II
20
The admin panel Lets create some links 3
21
Isadmin middleware
23
Main Template file
24
Localization
25
Elixir for the front end.
26
Admin Dashboard
31
“ We really should take a 5min break. Right?
32
The payment form Its time for our client to pay their link. Here is the fun part 4
34
AdminPaymentsController
35
Payment link route
36
The validpayment middleware
38
The payment link template body
39
The real deal. The payment controller
41
The Gateway implementation I have chosen BrainTree. It could really be anything you like. 5
42
Injecting an interface
43
The interface
44
The BrainTree implementation
45
A custom service provider
46
@if block now works in view!
47
User’s login Give a payment history to authenticated users. 6
49
The clef routes
50
The clef controller action
52
Integration Testing Automate the testing of your app 7
53
Backend testing
55
Payment form testing
57
Deployment Push to live and maintenance 8
58
"deployer/deployer“ package
59
Push to live command More info at http://deployer.org/docs dep deploy
60
“ Live as if you were to die tomorrow. Learn as if you were to live forever. ~ Mahatma Gandhi
61
Any questions ? You can find me at ◉ @lollypopgr ◉ Slides will be available at meetup.com Thanks!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.