Questions? Contact us on Facebook.
Script

Tech Tips to Build Tumblr like Social Platform using PHP Laravel Framework

Tech Tips to Build Tumblr like Social Platform using PHP Laravel Framework

This simple and crisp article explains the seven most important functions required to build a TUMBLR like Social blogging platform easily using the happening Laravel framework. This article is a contribution from a Laravel expert, who has developed an extensive clone of TUMBLR.COM using Laravel.

————————————————————-
              You can also download the source code HERE
————————————————————-

Eloquent :

The Eloquent ORM included with Laravel provides a beautiful, simple ActiveRecord implementation for working with your database. Each database table has a corresponding “Model” which is used to interact with that table. Using Eloquent, We don’t have to create long mysql queries, Its just a matter of calling a few functions. It also have chainable functions. It also has eager loading which drastically reduces the number of sql queries.

Routing system:

Laravel takes an incredibly simple and easy-to-use approach to routing. Most beginner PHP developers aren’t familiar with anything other than the most natural of route systems. It brings more flexibility and control over which route is triggered on the application. A directory is created to match any desired URI. For example, an index.php file is added to the following directory: /dashboard and now can be accessed by browsing to: rumblr.biz/dashboard/index.php. It allows to create links to named routes. While creating links just use the route’s name and Laravel will automatically insert the correct URI. This allows to change routes at a later time and it will update all of the relevant links site-wide.

Route::get(‘/dashboard’,’userController@dashboard’);

View Composers:

These are blocks of code that can be run when a view is loaded. A very good example of this would be a blog where it contains a list of blog posts. A composer would contain the logic to load the blog posts so that all one has to do is load the view. This keeps from having to make sure that controllers load a bunch of data from models for views that are unrelated to that method’s page content.

Return View::Make(‘blog’)->with(‘posts’, $posts);

Learn-Laravel

Automatic Pagination:

Laravel prevents application logic from being cluttered up with a bunch of pagination configuration. It gets the count of db records and selected data using a limit/offset called ‘paginate’ and interacts Laravel where to output the paging links in view. Laravel’s pagination system was designed for programmers to make their work easier to implement and change. Laravel can handle these things automatically and makes tasks easier.

Post::all()->paginate(10);

Responsive Images on the fly :

Imagecow can manipulate responsive images on the fly without shrinking the image. So, We don’t have to worry about the image sizes.

Composer :

Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you. Composer is not a package manager. Yes, it deals with “packages” or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it will never install anything globally. Thus, it is a dependency manager.

Bootstrap for responsive design :

Twitter Bootstrap is a CSS framework that helps in designing web applications. It is one of the easiest CSS frameworks to use in the Industry today. It assumes you have no designing knowledge and all you want to do is write some HTML as per the Bootstrap specifications. In short, Twitter Bootstrap has already written a CSS style sheet for you, has inbuilt jQuery support and also has some popular JavaScript tools.

————————————————————-
             You can also download the source code HERE
————————————————————-

 

Previous ArticleNext Article

Leave a Reply

Your email address will not be published. Required fields are marked *