PHP, Laravel, And Blockchain

Access all articles in sprocket icon.
Published July 4, 2017 by Bill Keck.

PHP, Laravel, And Blockchain

Anyone following my blog knows from my previous post that I recently published Bitcoin For Beginners. That’s not a programming book, but it does go deep into the cryptocurrency ecosystem, which beginners will find helpful.

After years of scoffing at Bitcoin, I finally did some deep research on it and found that I actually liked the concept and the architecture. And let’s face it, the crazy returns that people were seeing in their investments drew me to it as well.

I watched some videos on Bitcoin and blockchain and saw some examples of code in Python. So I jumped into my codeschool account and did the courses on Python, which I enjoyed.

But then, as I started Django, the web framework for Python, I started to really appreciate Laravel again, it’s such a wonderful framework to work with.

So I started looking around for PHP code that can interact with the Bitcoin blockchain, and found a couple of resources, including a blockchain api that integrates with Blockchain.info.

I didn’t find much for use with Laravel, but I did find one package, Maurocasas/blockchain.

Anyway, my research into blockchain has convinced me that there is a huge wave of adoption coming and that it’s an area ripe for development. Ladies and gentlemen, a lot of money is going to be made with blockchain…

As a PHP developer, I’m always worried that the language can fall out of fashion and into disuse. Those fears have mostly been put aside with the Laravel framework, since it makes working with PHP such a pleasure.

But I think we are falling behind in the blockchain space and I would like to see more tools developed. I’m still doing research on this, so perhaps the work has been done, and I just don’t know it yet. I’ll keep looking.

So far, I’ve only found fragments. For example, here is a stack exchange question on a merkle tree.

If you are unfamiliar with a merkle tree, it’s a cool structure of recursive hashes that are incorporated into blockchains like the ones Bitcoin uses. Also here’s a link to the Bitcoin whitepaper, which will give you some background on the overall architecture of bitcoin. It’s 9 pages that changed the world.

If you want more gentle explanations on the tech behind Bitcoin and blockchain, hit up youtube, there are a lot of great videos that explain it better than I can.

Hopefully, we’ll soon see new blockchain tools developed in PHP, and especially in Laravel.  Who knows, maybe we’ll see an official package like Socialite or Echo, but for creating a blockchain instead.  Wouldn’t that be cool?

Thanks again to everyone who has supported my work, especially with the positive reviews on Laravel 5.4 For Beginners.

Bitcoin For Beginners Officially Launched

Access all articles in sprocket icon.
Published June 28, 2017 by Bill Keck.

Bitcoin For Beginners officially launched

Ok, my third book of the year, Bitcoin For Beginners, is now out and available on Leanpub.com.

If you’ve been following the news lately, you’ve probably noticed that Bitcoin is getting some headlines, since a single coin is now worth about $2500.

I wrote an article in 2014, when Bitcoin had crashed to about $240.  I listed a long rant about why I thought Bitcoin was so bad.  Wow, I wish I had bought some instead of complaining about it.

I first came across Bitcoin in 2010, when I was doing research on virtual currencies.  At the time, Bitcoin was going for $0.30.  Even though I was considering building a token, for which I filed a provisional patent, I failed to grasp the value of Bitcoin.

Fast forward to 2014, just 4 years later, and Bitcoin was going for about $240, and I suppose I was looking for validation to my earlier opinion because I was very negative about it, even though, across that timespan, it had gone from $0.30 to $240.  That was the key detail that I somehow overlooked.

I also failed to ask the key questions, which were why would anyone pay anything for Bitcoin, and why would it go up in value?

In 2017, I’m a little older, a little more seasoned as a business person, and I’ve also become a programmer, which gives me a slightly different take on things, compared to the days when I didn’t code.

So this time, when I saw Bitcoin popping up in the news, I pretty much instantly knew that my previous opinions were wrong and that I needed to look into it further.

I have an interesting process for learning:  I write a book.

That might seem a little counterintuitive, since obviously I’m using it as a learning process. But having published 5 programming books, including Laravel 5.4 For Beginners, I’ve gotten to a point where the process of writing a book is an effective way for me to break everything down into the simplest components.

I’m never satisfied with sort of understanding something, I really want to understand it, so I dug deep into Bitcoin and other cryptocurrencies like Ethereum and Litecoin.

The result is a 101 page book, a gentle introduction to a fascinating space, the wild west of cryptocurrencies.  There’s a lot in those 101 pages, including the ICO craze that is sweeping through the market.

I look at cryptocurrencies with the healthy skepticism that any programmer should have, but at the same time, I keep an open mind to the possibilities it represents.

Although it’s not a programming book, Bitcoin For Beginners is relevant to the programming world, where a tectonic shift is taking place towards peer to peer networks and blockchain technology, leading toward a decentralized internet. These are fascinating developments and you don’t want to miss them.

The cryptocurrency world is filled with risks and we talk about those as well.  We talk about the speculation and volatility and look at some case studies to bring it all home.

In a sense, the cryptocurrency world is a special place that is owned by open source programmers, not corporations or governments, and that makes it very interesting to say the least.

Anyway, I try to create books that are of value to the reader.  It’s a difficult and competitive world that we live in, and I try to make things just a little easier for those trying to learn.

Thanks to everyone who is supporting my book.  We just got our first 5 star review on Goodreads.com.  I really appreciate that and hope that you find my work useful.  Thanks again.

Is Laravel Right For Enterprise Development

Access all articles in sprocket icon.

Published May 12, 2017 by Bill Keck.

Is Laravel Right For Enterprise Development

In the most recent episode of the Laravel Podcast, they spend some time talking about whether or not Laravel is right for enterprise development.

The question, as I see it, breaks out across handling two main points:

  • Scale
  • Complexity

We’ll start with the scale issue.  In the podcast, Jeffery Way makes the argument that most applications will never scale to the point of running into scalability issues with Laravel.

Let me just say upfront, I’m a huge fan of Jeffery Way and watch Laracasts religiously.  At the same time, I disagree with his thinking on scale for the same reason I wouldn’t recommend ignoring n+1 problem simply because there aren’t enough users on the application to create a problem.

In most cases, everyone involved in an enterprise will do everything they can to drive as much traffic to the app as possible, so it’s much better to be ready for it than not.

As I see it, this question is really not about Laravel, but about PHP in general and how you handle state. Personally, I love handling state through sessions, it’s just so easy to work with.  By using AWS and Redis, you should be able to handle quite a lot of scale, without having to go to stateless auth.  I should also note that Laravel does support stateless auth, though I have never personally used it.

Exactly how much scale you can get to using sessions is beyond my level of experience, but it’s worth noting that Facebook was built with PHP, and they have certainly achieved an amazing level scale.  But like I said, I’m not an expert on their architecture, so I’ll just point to a reddit post, and you can check out some opinions about PHP there.

Since PHP 7 was released, it alleviate a lot of the anxiety around using PHP because of the improved speed and performance.

In terms of handling complexity, I know from personal experience that Laravel is a pleasure to work with.  Imagine you have an application with over 500 tables, numerous apis, cron jobs, and extremely dynamic frontend requirements that lean heavily on javascript.

Laravel is perfect for that.  Laravel has a super-solid architecture that is easy to comprehend and work with.  It is so well thought out as a framework that it touches nearly every requirement you are going to come across.  And the thing is it doesn’t just provide all of your foundational code, it does it extremely well.

In the Podcast, Taylor Otwell, the author and founder of Laravel, talked about some reasons why someone might not like the framework, including:

  • objecting to the marketing of an open source project
  • personal dislike of Taylor himself

Let’s deal with the personal dislike of Taylor.  I’ve been following Laravel for 4+ years.  In that time, I’ve never heard Taylor Otwell make anything resembling an unprofessional statement of any kind.  So personal dislike of the founder, which is probably rooted in jealousy,  seems like a petty reason not to use a framework.

Business that make decisions based on pettiness tend to not do well in the market.

I also don’t understand why someone would object to a highly successful open source project having a commercial ecosystem around it.

Would you rather not have Laracasts or Envoyer to work with?  Honestly, I wouldn’t enjoy programming as much as I do if it weren’t for Jeffery Way and Laracasts.  Just think about how much he brings to the space.  Is it really that objectionable that he makes a living from it?

My company uses both Laracasts and Envoyer extensively.  Laracasts also turned us onto Vue.js, which is a great Javascript framework that is used extensively by the Laravel community, and for good reason.

Envoyer provides seamless deployments of your projects, and we have found it invaluable for our releases.  We’re more than happy that Taylor Otwell is compensated in some way for providing both the service and the phenomenal Laravel framework to start with.

Laravel provides first-class documentation, as if it were a commercial product, and yet it’s free.  As the leader of a company that relies on Laravel, I’m very excited and grateful for everything they do.

Another point I’ve heard from people is that Laravel updates too often, with big releases twice a year.  That means you have to migrate if you want to keep up to date, and that can be a pain.  But would you rather update less often and incur technical debt?  Who in their right mind would want that?  Eventually you will have to address technical debt and nothing is more ugly than that…

Laravel, and it’s supporting ecosystem, is capable of powering enterprise applications.   Recently, I mentioned a cliche in one of my books, 100 Patterns For Success, where I talk about the joke from the show Silicon Valley, where an engineer says:

“I want to change the world with a beautiful architecture that maximizes code reuse and extensibility.”

Everyone says that.  Taylor Otwell actually did it with Laravel.

Thanks again to everyone who is following my work, and thanks again for all the great reviews on Laravel 5.4 For Beginners, I really appreciate it.

Programmers Are The Future

Access all articles in sprocket icon.

Published April 27, 2017 by Bill Keck.

The future is rushing at us at incredible speed.  Industries are being disrupted.  The world is transforming itself at a pace never experienced before in history.

Entrepreneur Patrick Betdavid has said that entrepreneurs can solve 100% of the world’s problems.   If that’s true, and I think it may well be, then the vast majority of those entrepreneurs are going to be programmers.

The reason why I say this is pretty simple, which will hopefully be clear in a minute.

I watched Betdavid step through a simple list on how to become an entrepreneur:

  1. Build a team with complementary talents.
  2. Identify the industry you are interested in.
  3. Identify problems within that industry that need solving.
  4. Determine which companies are already trying to solve those problems.
  5. Determine whether or not the companies trying to solve the problems are weak or strong.
  6. If you determine that the company that is trying to solve the problem is weak, then you may have identified an opportunity.

The way to solve problems and beat the competition is through innovation.  Who better to lead that innovation than programmers?

So that’s really good news for programmers.  We have almost unlimited opportunities in front of us.

However, as I state in my book, 100 Patterns For Success, I don’t think finding opportunity is as simple as just running through Betdavid’s list.

I can easily identify opportunities.  I think Bitcoin, for example, is ripe for disruption.

For one thing, their technology is not being updated and it won’t be able to keep pace with the evolution of devices.  This is a weakness.

While there are more and more centralized cryptocurrencies coming on the market, which address part of that concern, none of them are particularly strong.

So does that mean I’m the right guy to come up with the solution?  No.  I don’t have a passion for it.  The idea of working with cryptocurrency doesn’t excite me as a programmer.

People who are not passionate about what they are doing, but are simply chasing an opportunity, are almost 100% guaranteed to fail.  Inevitably there will be difficulties that will chase most of them out of the industry, and sooner, rather than later.

On the other hand, if you are kept up at night by thinking about all the possibilities of a cryptocurrency and how cool it would be to code it, you would at least have a chance of making it.

As an entrepreneur, the odds are always stacked against you.  The failure rate is insane and deciding to be an entrepreneur is not a rational act because almost any objective analysis of whether or not you will be successful almost always points to the negative.

Those who go on in the face of hopelessness are born to be entrepreneurs.  But this is easy for them because they don’t think of it that way.

Entrepreneurism is an act of self-expression.  We do it not because we want to, but because we have to.  Often, we have no other employment options because we simply don’t fit in anywhere.

Most entrepreneurs fail due to lack of capital.  The interesting thing about programmers is that we trade in a different kind of currency, code.  And that code can be incredibly valuable, even though it doesn’t take a lot of capital to write it.

I got involved with writing educational books about 4 years ago, introducing programmers to PHP frameworks.  My most recent programming book is Laravel 5.4 For Beginners, which is rated 5 stars on GoodReads.com, so thanks to everyone who rated it.

I wrote the 100 Patterns For Success to help programmers understand how they can use the incredible talent that they have to drive towards greater success in life.

So to get back to Betdavid’s assertion that entrepreneurs will solve 100% of the world’s problems, and if you accept my proposition that those entrepreneurs will be programmers, then that’s both an awesome responsibility and a great privilege.   Part of my mission is to help you make the most of it.

Thanks again to everyone for supporting my work.  Ratings, reviews, shares, likes, and comments are greatly appreciated.

100 Patterns For Success Officially Released

Access all articles in sprocket icon.

Published April 20, 2017 by Bill Keck.

100 Patterns For Success Officially Released

I’m proud to announce the release of my latest book, 100 Patterns For Success.

One day I was listening to the Laravel podcast, and they were talking about books on success, like “Rich Dad, Poor Dad” by Robert Kiyosaki, and how it didn’t leave the best impression with them.

I thought about the disconnect that many books on success have with the tech community, which is in large part because these books are not written by programmers.

The story of someone else’s success and their opinions is not really all that useful.  Why would we care about how someone built Block Buster Video out of a trash business, which is what Wayne Huizenga did?  Do we really care what Robert Kiyosai’s opinion on the psychology of success is?  Is it important that we know that Richard Branson’s dad threw him in a river when he was a boy to teach him how to swim?  Yes, that made him tough at an early age, it’s an interesting tidbit, but how does that help you?

Well, truth be told, there are valuable lessons in all those books.  I’ve read many of them and I don’t want to leave the impression that I don’t like them because I do.

But on the other hand, I can see why programmers might not like them.  For one thing, the average programmer is not an average person.  They are a little brighter to begin with, and in many cases are smarter than those older generations of people who made it big.

Programmers are more inspired by how things work, not how much money you stuffed in the bank.  We’re more interested in adopting useful workflow patterns and inventing things, than we are in psychological coaching.

So I stepped up to the plate to see if I could combine the two concepts.  I defined 110 patterns that you can adopt into your behavior that will point you toward success.  I know the title has 100 in it, but I added 10 more as a bonus.

I developed the patterns in a very open way, so that you can build your own system of thinking from it.  You can keep or discard the patterns as you like.  You can be inspired or disagree, but at any rate, you will be stimulated and exposed to new ideas and new ways of looking at things.

I recruited a lot of tech billionaires, rock star CEOs (and one actual rock star), and many others to lend their voice to the concepts.  The book contains many quotes from Peter Thiel, Elon Musk, Steve Jobs, Bill Gates, and many others.

We also look at brief case studies of Google, Yahoo, Youtube, Uber, Slack and many others.  We provide valuable insights into how some of these startups stack the odds of success in their favor before they even get started.

This book would be a benefit to any programmer who is even remotely considering starting their own venture.   As I point out the numerous times in the book, I believe that programmers are the ones who should be running companies.

Thank you for continuing to support my work.  If you do purchase the book, I have one small request, and that is that you rate and/or review the book at GoodReads.com.

Recommending this book to friends is a nice way to say thanks, I would really appreciate that as well.  Thanks again.

 

Admin-Dash uses Admin LTE for Laravel 5.4

Access all articles in sprocket icon.

Published February 26, 2017 by Bill Keck.

Admin-Dash uses Admin LTE for Laravel 5.4

I built an admin panel implementation for Laravel 5.4 using Abdullah Almsaeed’s amazing  Admin LTE template.  I’ve made this starter application available for free on github:

Admin-Dash

On the admin panel itself, I’ve pulled in all the examples, including:

  • Layout Options
  • Widgets
  • Charts
  • UI Elements
  • Forms
  • Tables
  • Calendar
  • Page Examples
  • Documentation

You can reference everything from within the application.  This includes cool plugins like flot charts and map integrations.  Just go to the github page for a screen shot of the panel itself. You can learn a lot by playing with this template and looking at how things are implemented.

In addition to all the amazing plugins you get out of the box with Admin LTE, I’ve also incorporated one-click social sign in for Facebook and Github.  I also created some examples, using Vue.js for datagrids with paginated, sortable, and searchable data columns.

If you are familiar with my book, Laravel 5.4 For Beginners, you will recognize many of the implementations from there.  On the other hand, things are a little more complicated.  For example, we use 3 master pages:

  • guest
  • auth
  • admin

And there are lot of partials to go along with them.  Doing it this way gives us a lot of flexibility over managing assets and cuts down on a lot of if statements in the views that would otherwise check to see if the user was a guest, logged in, or logged in as admin.

I’ve become a big fan of view partials.  For example, even if a form is simple, I extract it out to a partial.  This really helps with code separation, since I can dedicate the main view files to layout instead of logic.  It also has the effect of making the code so much more readable, helping with maintainability.

Also in this implementation, I extracted out some child components for the datagrids in Vue.js, which cuts down on code repetition.   I got rid of the big ugly handler for all the queries and put in a utilities file.

Those are all extras, however, and you are free to use or not use them as you wish.  The main focus was in pulling in the main Admin LTE template in a Laravel starter application that is a great starting point for building something.

The github page includes github instructions for forking Admin-Dash, so you can pull the repo into your github account and play with it from there.  I also included installation instructions for the app key, .env file, and a few other settings that you will need.

Thanks again to everyone who is supporting my work by purchasing my book.  Also, I’m happy to report we got our first ratings, which all came in at 5 stars.

Please leave a rating or review at GoodReads.com, it will help get the word out for the book, I really appreciate it.

 

 

 

 

 

Dependent Dropdown Form Vue.js and Laravel 5.4 For Beginners

Access all articles in sprocket icon.

Published February 14, 2017 by Bill Keck.

Dependent Dropdown Form Vue.js and Laravel 5.4

I have officially released chapter 15 of Laravel 5.4 For Beginners today on Valentine’s Day.  This bonus material is free for anyone who has purchased the book.  Updates to the book are free for the life of the book, one of the great things about the leanpub.com platform.

With the release of chapter 15, it brings the page count to over 900 pages.  It may be 900 pages, but it’s a gentle 900 pages, generous with screenshots and code.

Chapter 15 focuses on a robust example of dependent dropdown lists on a form.  We set up all models, so the data for the lists can be pulled into the form, which uses a custom Vue.js component to enforce the dependency.

In the chapter we work on a Lesson model, which has a category and a subcategory.  The subcategory belongs to a specific category, so we only want to show the subcategories that belong to it in the form.  By explicitly naming the parent/child as category and subcategory, it makes it easy to follow and keep track of which one is the child.

We also want to enforce the dependency through server-side validation, which prevents the form from being spoofed.  Projects tend to eventually  have some kind of complicated validation, so we walk through the options for creating that.  It turns out it’s pretty simple to do.

A lot of my readers have bought my previous books, and this puts a lot of pressure on me, when I do a new release, to make the new book worth purchasing.

With that said, here is some of what is covered in this book that is new to this book:

  • Laravel Mix (Replaces Elixer)
  • Events
  • Sending Mail and the new Markdown features
  • Service Container
  • Service Providers
  • Dynamic Facades
  • Query Scopes
  • Real-time Chat with Laravel Echo, Vue.js, and Pusher
  • Custom command to run as cron to cleanup old chat messages
  • Dependent Dropdown list on form with Vue.js

If you add to that list the data grids we build in Vue.js, you can see that you get a fair amount of Vue.js included in this book.  That’s a trend I see continuing for the foreseeable future, since Vue.js is so easy to work with and an application without javascript is not likely to be very interesting.

Laravel 5.4 For Beginners is no substitute for a dedicated book on Vue, my favorite for that is The Majesty of Vue 2, but Laravel 5.4 For Beginners can help you get up and running, teach you the basics, and help you take advantage of some of the really cool reactivity we can create with Vue.

Other fundamentals we cover are image management, access control, middleware, and one-click Facebook sign in and registration with Socialite.  My goal is to help you advance your programming knowledge, so that if you start the book as a beginner, you end it being more intermediate.

I’ve always felt that programming is a journey that Laravel makes more pleasant and productive, and I’m happy to share that journey with you.

Thanks again to everyone who is supporting my work by purchasing the book.  Please leave a rating or review at GoodReads.com, it will help get the word out for the book, I really appreciate it.