logo
We provide creative solutions in form of web and mobile applications to clients around the world, creating apps that get attention and meaningful.

Web Development

Mobile Applications Development

Business Solutions

Odoo ERP Implementation

Wordpress Plugins

WordPress Themes

Laravel Development

Server Security

Server Administration

Mobile Marketing

Pay Per Click (PPC) Management

Conversion Rate Optimization

Email Marketing

Online Presence Analysis

Fell Free To contact Us
We are available from Monday to Friday 9AM to 6PM.

talk@appknitters.com

Lahore, Punjab, Pakistan

Top

There are a couple of "parameters" of an Eloquent model, as properties of that class. The most mainstream ones are presumably these: class User extends Model { protected $table = 'users'; protected $fillable = ['email', 'password']; // these fields can be filled with User::create() method protected $dates = ['created_at', 'deleted_at']; // these fields can be disabled protected $appends = ['field_1', 'field_1']; // additional values returned...

Many times you need to check against some condition for records returned by relationship in Laravel Eloquent. For example you only want a list of users which are approved or verified. Normally we do it this way : public function list_users() { return $this->hasMany('App\User'); } Then for returned users you need to iterate the list and check if it is approved or not. But there is a short and easy way to do it: public...

Great database design is necessary for building scale-able , high-performance applications. If a database works well, everything is on right track. Small decisions, in the beginning, have a huge impact on future development of any system, specially database. Database Design Best Practices If you are going to design a database for your next project, then please keep these best practices in mind while working on the project. 1. Normalization To make high-performance and fast systems, it’s critical to normalize database to...

In this article, we have hand-picked the best 4 WordPress plugins for WooCommerce that you must use. 1. WooCommerce Products Slider WooCommerce Products Slider enables you to effectively make excellent product sliders and include them anywhere on your WooCommerce store. 2. WooCommerce Customizer WooCommerce contains a huge amount of hooks which allow you to tweak button text, labels, and more, however, you need to write PHP code to utilize them. This module allows you to use those hooks without expecting...

Eloquent has some functions that combine two methods, like “please do this, otherwise do that”. findOrFail(): If you want to do one task otherwise another then do it like this: $record = Record::findOrFail($id); Instead of: $record = Record::find($id); if (!$record) { abort (404); } firstOrCreate(): If you want to create a record but only if it does not exist already in database, then do it like this: $record = Record::firstOrCreate(['name' => $name]); Instead of: $record = Record::where('name', $name)->first(); if (!record) { Record::create([ 'name' => $name ]);} ...

Many times while working on a project, we need to increment value of certain columns in database. Laravel is shipped with some semi-hidden function to do various tasks. One of those are methods to perform increment or decrement on database columns. Normally we do the increments and decrements this way: $post = Post::find($post_id); $post->read_count++; $post->save();   But with Laravel eloquent methods we can do this: $post = Post::find($article_id); $post->increment('read_count');   Another way of doing this can be: Post::find($post_id)->increment('read_count'); Post::find($post_id)->increment('read_count', 5); // +5 Product::find($produce_id)->decrement('stock'); // -1 Product::find($produce_id)->decrement('stock',5); // -5 ...

Laravel is a PHP based MVC Framework that radically improves PHP development efficiency. It has been around for a long while. Its major version was released in June 2011, around 8 years ago. Since then Laravel team is constantly improving the Framework. Here is a portion of the highlights that make it the best PHP framework: MVC Pattern The Model-View-Controller (MVC) is a design that isolates an application into three primary legitimate parts: the model, the view, and the...