Well, first of all it has nothing to do with hacking but it’s a new open-source programming language developed by FaceBook team which is based on PHP and runs on HHVM (Hip Hop Virtual Machine), the FaceBook’s virtual machine which also supports PHP as well. Hack: a new programming language...
→ Read MoreOften we may need to pass variables from server side to client for using it in a JavaScript file or in a global script. It’s possible to write JavaScript code from server side script, for example, we may use something like this: echo "<script>var userId = " . Auth::user()->id ....
→ Read MoreLaravel is one of the most popular PHP MVC frameworks and taking the Php community rapidly than any other frameworks probably couldn’t do and it’s because of a great combination of power, extensibility and easiness. The framework provides so many ways to a developer to develop an application using one...
→ Read MoreIn Laravel there is a nice way to listen for many events, built-in and custom events, simply using code like this: Event::listen('event_name', function($object) { }); We can register event listeners. In Laravel documentation on their website, mentioned about Application Events and also about Custom Events (defined by user). There are...
→ Read MoreLaravel provides a nice and easy way to build model relationship using some methods like hasOne(), hasMany(), belongsTo() and belongsToMany() and each one of these methods are used for different kinds of relationships, for example, hasOne() used for one to one relationship and hasMany() for one to many and so...
→ Read MoreLaravel provides a nice extensible and easy validation class to validate user inputs but Sometimes we may need to forcefully invalidate a passed validation. For example, a few days ago I realized that in one of my projects. I had a table with fields group_name and name along with other...
→ Read MoreAccording to Laravel, all multi-result sets returned by Eloquent, either via the get method or a relationship, will return a collection object. This object implements the IteratorAggregate PHP interface so it can be iterated over like an array. However, this object also has a variety of other helpful methods for...
→ Read MoreThere is no Input class in Laravel, instead it uses Request class for any Input::method() calls. Basically, we extend a class in OOP language to add some extra functionalities to a base (already created) class and in PHP, for example, if you have following class class BaseClass { public function...
→ Read More