Laravel 5.x Cookbook Chat Area

Posted: 2016-10-20 17:54:37

Topics


Just wanted to make a place to centralize some comments and feedback around the book Laravel Cookbook

I will do my best to reply and help with the book as needed.

The main repo for this book is here btw

Just add comments below and I will get them.


Events

Wednesday October 26th 2pm EST

Will host a live hangout for all to join and ask question. I will try and do this once per week for a bit here

Session one. Here is a little intro

Future sessions I will record

Wednesday November 2nd 2pm EST

Will host a live hangout for all to join and ask question. I will try and do this once per week for a bit here

Thursday November 10th 2pm EST

Will host a live hangout for all to join and ask question. I will try and do this once per week for a bit here

Wednesday November 16th 2pm EST

Will host a live hangout for all to join and ask question. I will try and do this once per week for a bit here

Wednesday November 23th 2pm EST

Will host a live hangout for all to join and ask question. I will try and do this once per week for a bit here

Questions

ComicClientInterface

For example, at chapter 3, page 34, point 4, the book says: “And in the ComicClientInterface class, I handle the comics method like this.”. And then there is a screenshot of the comics function, but there is no clue about in which file put these lines of code, and no mention of ComicClientInterface so far.

Answer

The first part but there is no clue about in which file put these lines of code is me assuming you would know it is the controller since I show the route. Sorry about that assumption. I see now I could have been more clear that just showing this

Route::get("api/v1/search", "SearchComics@searchComicsByName");

I should also have noted this relates to, as always in Laravel "app/Http/Controllers/SearchComics.php" eg CLASS_NAME is before the @

Yes you are correct. At that start of this process I had Chapter 8 "Testing" as the first chapter in the book since I start projects with testing and was trying to show that as a foundation to all these recipes but when I was asked to move it to Chapter 8 I missed this "context". Chapter 8 section "Using tests to think through your code TDT (Test Driven Thinking)" starts to cover that.

And moreover, I have not idea how to get the result showing in the next picture, at point 5. Where do these informations about comics come from? Later in the book I see there is a MARVEL_API_BASE_URL= https://gateway.marvel.com but how can the example in chapter 3 work without pointing to this url?

Answer

Again sorry it is confusing seems this Context is lost as above. You are correct you needed to have the URL in your .env file to make this work. It is in section 10 of Chapter 8 section "Using tests to think through your code TDT (Test Driven Thinking)" starts to cover that.


But there is no mention about this file "@extends(‘layout')"

Furthermore, at page 41, the book show how to write a route_view.blade.php file than at the first row refers to a layout.blade.php file: "@extends(‘layout')". But there is no mention about this file, until page 70 when his says: “t has made resources/views/layout.blade.php, which is the base to all your Blade files. In here, we see content.” and then there is a screenshot that show the content of this file. And this is a very simple and beginning topic in Laravel Framework. So, how is supposed that a person could follow the book, if there is full lack and references to future parts of the book?

Answer

As noted above we had some chapter changes that may have caused this. Chapter 4 "Organizing your Blade files" I install a template helper that brings in this file. Basically I think that Routing was written after Views. But honestly on that one I am not sure why I would have done that since imo I needed to tackle Routing before I can show you views.



Tags: