Laravel learning notes, day 2

0

Welcome to the second blog post under Laravel learning notes. In first post, we installed the laravel. If you missed that post, click here to go to day 1.

I am Kapil Sharma, Technical Architect at Eastern Enterprise and working on web technologies since last 10 years. You can find more about me on my personal website kapilsharma.info or contact me through twitter @kapilsharmainfo or contact us from on website.

I am publishing my notes I made for personal reference while learning laravel. Although I do not include very basics of language in my personal notes but since I’m publishing these notes, I’ll add some more basics here for those trying to learn laravel using my notes.

Day 2

Today, we are going to discuss basics of:

  1. Routes

  2. Views

  3. Blade

Views are the part of MVC architecture so if you are not familiar with MVC architecture, please look it on google. MVC basics are out of scope for these notes. (more…)

Laravel learning notes, day 1

1

Welcome to the first blog post under Laravel learning notes.

I am Kapil Sharma, Technical Architect at Eastern Enterprise and working on web technologies since last 10 years. You can find more about me on my personal website kapilsharma.info or contact me through twitter @kapilsharmainfo or contact us from on website.

I am publishing my notes I made for personal reference while learning laravel. Although I do not include very basics of language in my personal notes but since I’m publishing these notes, I’ll add some more basics here for those trying to learn laravel using my notes.

Prerequisite

In these notes, I’m going to cover all the basics of laravel but I do expect readers have moderate to good understanding of PHP. Knowing any other MVC framework is not essential but good to have as I’m not going to cover basics of MVC design pattern. If you don’t know or understand MVC, just google it a bit.

Installation

First step while learning anything new is to install the tool, in our case, laravel. We will install laravel through composer. Using laravel (or probably any other PHP project) using homestead or custom vagrant box is recommended in professional development environment but that is currently out of scope for this post.

We mostly use composer to install laravel. Composer is the dependency management tool for PHP. Dependency management tool basically read a configuration file to identify all the project dependencies and install them. Assuming you do not have composer installed, lets first install composer. (more…)

GEt 50% off on Meetup.com

0

Meetup.com is very good platform to organize your meetups. I recently planned to organize my PHP meetup. Price is not too much, just 2 dollers/month for 6 month plan; $12/6 months (In Indian Rupees as per exchange rate, approx Rs. 720 as of now.)

Not a huge amount but still if you are serious about meetups, you can get 50% off on first billing. Just start creating your meetup group and when you reach to payment page, close the browser/tab. With in 2-3 days, you will get mail from meetup.com offering 50% discount, applicable for limited period. Grab it immediately.

Please note, in case you had not made your mind to start meetup gorup, dont try this trick. You get this offer only once and once it is expired or used, same trick will not work on your account.

Responsibilities of technical user group

0

I recently started thinking (mind it, just thinking) to start new PHP user group in Pune. Why? Isn’t there any PHP user group in Pune? Actually there are three.

First one is inactive since last 2-3 years so lets not count it.

Second and third are relatively new and active, but I PERSONALLY feel they are going in wrong direction. Please note this is my personal thinking and I might be wrong. Since I agree I might be wrong, lets not go into details. However I’ve a basic idea of what a PHP user group must do. I’m just writing my idea, please correct me if I’m wrong.

  1. First and most important, user group is a community and a community do not belong to anyone particular. One could be organizer, lead contributor but one can not be owner of a community. If there is a owner, I personally feel difficult to call that group as community. For me, its a private limited company.
    So if you are organized and lead contributor of a community, don’t ever try to force your decision. Listen to everyone in the community. They might be wrong but if they are wrong, explain them why they are wrong. At the same time, you might also be wrong or no one can be wrong. Key point is, in a community, listen to every one, have healthy discussion and take joint decision.
  2. An important responsibility of community, ‘A community must take care of its new members.’ By new members, I do not mean new members to user group but I mean students learning programming and professional developers who recently started working (less then 2 yrs exp.). A community will grow old and die if we don’t take care of new members.
  3. Now most important responsibility of technical user group: Share knowledge. In technical world, technologies changes rapidly. One individual can not be master in all technologies. So these knowledge shearing sessions, targeted for experienced developers, are main goal of a community. This also allow us to build relations. As senior technical person, you are not expected to have solution of each and every technical problem but at least have knowledge who can help to find correct solution to new technical challenge. Being a part of community, you get that knowledge.

We can add multiple low level goals but above three are most important high level goals of a community/user group. If they are missing, sorry I personally feel it difficult to call your group as community. Please correct me if my idea of technical user group is wrong. I’m very much open for healthy discussion.

Career 1.0: Selecting your first Programming Language

2

In last 2 months, at least 4-5 computer science students asked me which language should they select/learn for their final year project and career? I was surprised what should I answer. Selection of programming language is generally based on your existing knowledge or project.

Problem here is, two of the most crucial factors of selecting programming language are missing here which make it very difficult question to answer.

Before we answer this question, we must first understand how most programmers select language for any project. There are two major factors:

  1. Existing knowledge.
  2. Project requirements.

Existing knowledge is very important. Suppose you know Java and someone give you choice to work on either Java project or PHP project. Your selection is obvious; Java. Why? Is it because Java is better than PHP? No, no language is better than other. You choose Java just because you know Java or in other words, you didn’t chose PHP because don’t know it and you are scared of learning it. Thats human nature. Changes are difficult for humans and we don’t want to go out of our comfort zone. Another reason, which is more valid, programming language is just a tool to fulfil business requirements and if I can do it with existing tool, why should I purchase another tool.

Second reason is project requirements. Now assume you are PHP programmer and you got a project to make a desktop application. Since PHP is not a good tool for desktop applications, your project requirements are forcing you to switch programming language. No matter which language you choose but you definitely will not choose PHP. Please note this is just an example when project force you to switch language but not a practical example as ‘only PHP’ developer will never accept desktop application project. However in real world, you sometimes get project that can be done in your programming language but learning and doing in some other language is more convenient, based on multiple factors like production server availability, existing team knowledge, client preference etc.

(more…)

KapsBudget

0

On Friday, I posted a tweet.

Good morning, still wondering what is the best (and common) technique to learn hell lot of #frameworks in #PHP

That was just casual tweet followed after some other instances. But when I reviewed my week’s tasks (it include nearly everything I did over weekend) I realize I’m complaining. I immediately replied to myself:

@kapilsharmainfo (To self) It’s easy to point out problem but how many of us work to fix it? Fix it or don’t complain about it. #WeekendTask

That mean either I should try to fix it or just keep quite. This is the starting point to think how I can help to fix this problem. There are many huddles like:

  • PHP frameworks lie in three categories; Micro framework, Full fledges framework and component based.
  • Their target audience is different, some framework provide basic features and target small to medium projects while other target enterprise applications. How a common solution is provided for such a wide targets.
  • There are many kind of people, some like to go through theories first and someone prefer to start doing things first and prefer learning by doing things. There are others who go for mixed approach. There are many who prefer to go through any available project example and learn by going through existing code. Symfony really made it easier through jobeet project and frankly I’m impressed by that approach.

Obviously no one can give one common solution. Still after considering quite a few facts, I personally feel if we have one example project implementation with us, learning become easier. So my Fix is:

MyFix:

(more…)

My reply to lot of replies to my tweets

0

Please note, I mean no disrespect to anyone, anything. Whatever I said was my thinking from my view point. I don’t feel everyone should/will agree with me. Everyone view is based on multiple factors. This post is about my view, my thoughts and I’m not claiming my thought is correct but yes, they will not change soon.

Why I’m writing this? I recently posted a tweet, tweet was:

Worried about #codeIgniter future, one of my favorite frameworks. Let’s see how it goes ahead. Started learning #laravel for worse case.

While writing it my target audience was just few friends who follow me and occasionally reply. However I was surprised when my mailbox filled with quite a few mail like @xyz replied, @abc retweeted  etc. One reply was from Taylor Otwell. His reply was:

@kapilsharmainfo @CodeigniterCMS i think you mean best case? ;)

Those who don’t know him, he is author and lead developer of Laravel; One of the most popular and probably one of the best PHP frameworks right now. I follow Taylor, his site, blogs, twitter; I’m his fan and wanted to be like him. Still Taylor, sorry but it was not typo. I mean worse case. Please, let me explain.

There were few other replies as well, few of them were:

Learning Laravel is the best case scenario. I came from CI and Zend. Laravel is much better.

Coming from CI myself I must agree

 

worst case? That’s upgrading mate…

 

Yes I agree with everyone. Developer within me agrees. Professionally I’m Technical Architect in a software company, I as Technical architect agree. This month only, I’d taken few official sessions about Coding standards, Code Sniffer and Test driven development. Laravel, as I read at many places, is one of the best examples of TDD. How can I disagree with anyone of you? Yes, I agree with everyone.

But after office hours, I’ve one more personality. I’m weekend developer. As weekend developer, I work on quite a few personal client projects, some personal projects. These projects are not enterprise apps, but apps that are targeted to be finished during 1-3 weekends. Weekend developer within me does not agree with any of you.

(more…)

Setup Advanced PHP Dev env on Windows (Part 2)

0

In Part 1 of this article, we already setup WAMP, PEAR and PHP Unit (edit: and Code Sniffer). If you missed that part, please go through Setup advanced PHP Dev-Env on windows part 1 first.

In this part, we are going to setup following:

XDebug: XDebug is used to debug PHP code and easily integrates with leading IDE like Netbeans.

Phing: Phing is PHP project build tool, based on Apache ANT.

Composer: Composer is new dependency management tool in PHP world.

(Edit) Code Sniffer: Check if your code is following standards. You can define your own standards.

Again to remind, this is not tutorial for given tools, we are just setting up the environment with these tools. Respective website is the good start point if you want to learn more about these tools. In future, I’ve plans to make a simple kick start tutorial for these tools but till then, go through official documents and Google for tutorials on these tools. (more…)

Setup Advanced PHP dev-env on Windows (Part 1)

1

I regularly visit forums, stack overflow, IRC channels to ask questions and giving back open source community whatever possible for me. Obviously I learned much from those places and owe them. One of the common questions asked on community how to setup development environment. Obviously not basic one but advanced like how to setup Pear, Composer, XDebug, PHP Unit etc. All these are vital tools for development. So I’m trying to cover all these common questions on one single post.

Please note here I’m setting advanced PHP development environment on Windows 7.

(more…)

PHP: Bad design: Good result

0

Few weeks ago, I was just checking blogs from IT greats, as I usually do. I went through an interesting post PHP a fractal of bad design. It had a nice start-up

I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.

You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.

You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.

You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.

And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.

Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.

That’s what’s wrong with PHP.

(more…)

Go to Top