Hello World, I'M Laravel

Hello World, I'M Laravel

So there is this thing called Laravel. You may have heard of it already, but you’re not sure what it is actually about? Or you do, but want to know more about it? Great, cause this talks is especially for you! Laravel is at the same time one of the youngest and most popular PHP frameworks out there. So how does this work together? Let us take a closer look at why it is that popular and how it could be of use for you too. We will go through the main functionalities and talk about all the brand new features in version 5. So be there!

14d39e65f615fd6dcb9dd44ea7f7995b?s=128

Christoph Rumpel

November 27, 2015
Tweet

Transcript

  1. 1.

    H E L L O W O R L D

    , I ’ M L A R AV E L C H R I S T O P H R U M P E L
  2. 2.

    A F R A M E W O R K

    I S JUST A TOOL
  3. 3.

    A F R A M E W O R K

    I S JUST A TOOL could be more!
  4. 4.

    G R E AT F O R B E G

    I N N E R S A N D R A P I D D E V E L O P M E N T L A R A V E L I S …
  5. 5.

    L A R A V E L I S …

    M A D E F O R A L L K I N D O F P R O J E C T S I Z E S
  6. 6.

    L A R A V E L I S …

    A N E C O S Y S T E M
  7. 8.

    W O R K I N G F O R

    L I E C H T E N E C K E R . AT
  8. 9.

    F I N D M E C H R I

    S T O P H - R U M P E L . C O M @ C H R I S T O P H R U M P E L
  9. 10.

    TAY L O R O T W E L L

    T H I S G U Y
  10. 11.

    G E T T I N G R E A

    L S TA R T S W I T H T H E I N T E R FA C E , T H E R E A L S C R E E N S T H A T P E O P L E A R E G O I N G T O U S E … . T H I S L E T S Y O U G E T T H E I N T E R FA C E R I G H T B E F O R E Y O U G E T T H E S O F T WA R E W R O N G . “ “ G E T T I N G R E A L B Y 3 7 S I G N A L S , C R E A T O R S O F B A S E C A M P.
  11. 12.

    C O D E E X A M P L

    E S A R E S I M P L I F I E D !
  12. 13.

    F I R S T S T E P S

    L A R A V E L
  13. 14.

    R O U T E S W H E R

    E D O Y O U WA N N A G O
  14. 19.

    E L O Q U E N T N O

    T H I N G I S M O R E E L O Q U E N T T H A N
  15. 22.

    $recipe = Recipe::where('name', ‘Lasagne’)->get(); $recipe = new Recipe; $recipe->name =

    ‘Lasagne’; $recipe->save(); $recipe->update([‘name’ => ‘Sushi’]); $recipe->delete(); C R D U
  16. 26.

    class RecipeController extends Controller { public function index() { $recipes

    = Recipes::all(); return view(‘recipes.index’, [‘recipes’ => $recipes]); } }
  17. 27.

    public function store() { $validator = Validator::make(Input::all(), [ 'name' =>

    'required|unique:recipes|max:255', ]); } if ($validator->fails()) { //… redirect with error message } Recipe::create(Input::all()); // …success message
  18. 28.

    B L A D E D E F I N

    E Y O U R V I E W
  19. 29.

    // …views/layouts/master.blade.php <html> <head> <title>My recipes</title> … </head> <body> <div

    class="container"> @yield('content') </div> @include(‘parts.footer') </body> </html>
  20. 32.

    M I G R AT I O N S W

    E L C O M E
  21. 38.

    N E X T L E V E L L

    A R A V E L
  22. 39.

    M I D D L E WA R E M

    A L C O L M I N T H E
  23. 42.

    public function handle() { if ($this->auth->guest())
 {
 // … redirect

    to login
 }
 
 // let the request through }
  24. 44.

    D E P E N D E N C Y

    I N J E C T I O N D O N ’ T B E A F R A I D O F
  25. 48.

    class RecipeController extends BaseController { protected $mailer; public function __construct(Mailer

    $mailer) { $this->mailer = $mailer; } public function store() { //… store logic $this->mailer->send(…); } }
  26. 51.

    A R T I S A N C O M

    M A N D - L I N E I N T E R FA C E
  27. 57.

    class RecipeController extends BaseController { public function index() {…} public

    function create() {…} public function store() {…} public function show() {…} … }
  28. 61.

    F O R M R E Q U E S

    T B E T T E R VA L I D A T I O N
  29. 62.

    public function store() { $validator = Validator::make(Input::all(), [ 'name' =>

    'required|unique:recipes|max:255', ]); } if ($validator->fails()) { //… redirect with error message } Recipe::create(Input::all()); // …success message
  30. 68.

    T E S T I N G E N L

    I G H T E N
  31. 72.
  32. 74.
  33. 75.
  34. 78.
  35. 79.

    L A R AV E L I S M O

    R E T H A N J U S T A T O O L
  36. 80.
  37. 83.

    Resources • http://laravel.com/ • https://laracasts.com/ • https://forge.laravel.com/ • https://envoyer.io/ •

    http://lumen.laravel.com/ • http://www.laravelpodcast.com/ • http://bossfight.co/man-photographer/ • https://unsplash.com/