What’s New in Laravel 5.5

Laravel 5.5 is scheduled to be released in August of 2017 and is slated for the next major release.

Below are the few useful links, which will have all the latest features and improvements in Laravel 5.5

Happy Learning!

 

Roadmap To Learn PHP & Laravel

Recently, I got an opportunity to train new joiners at the Cygnet Infotech. And I found this very helpful blog post related to that.

Roadmap To Learn PHP & Laravel

Thanks to  @introwit for the blog post.

This roadmap lists the complete course from step 1 to the end that will help a beginner learn PHP in the correct order right from scratch understanding almost all aspects of the language.

To be up to date with Laravel, you can follow top 15 Laravel Heros. You will learn many tips and tricks which will helpful into your day to day development.

If you are ever stuck somewhere while learning, hit me up on twitter at @solaniviral and I will be glad to help you.

Happy Learning!

Laravel : Best Practices

There are Many PHP Frameworks Available And I’ve worked with Zend, CakePHP, CodeIgniter then I picked up Laravel in 2014 and with version 4.2. Trust me, I totally love it now.

Speaking about Laravel, it is simple and comfortable to use, suitable to start with writing the production code, and gives a great boost to a development process. One thing that I love about Laravel is that it’s built using the best practices used in programming available in the current times.

Here are some simple things worth having in mind when developing in Laravel:

  • Try to make use of your .env file to the max you can.
  • Don’t create tables or index directly via PHPMyAdmin or console. Use Database Migration to create table, add/alter any fields, and commit those to Git repository.
  • Don’t insert fake values directly into the database for testing purposes. Create Seeder files or user Model Factory to populate your database.
  • Prefer to use Artisan CLI more than manually creating stuff, it’ll fasten up your productivity.
  • Make sure to boost performance using some artisan commands:
    php artisan route:cache
    php artisan config:cache
    php artisan optimize — force
  • Try not to write closures into your routes.php file, instead move them to your controller.
  • Use Named based Routing.
  • Be careful with the naming conventions when creating custom classes and functions, especially with your Models. Laravel works on a principle such that, for a table named users, it would expect it’s model name to be User.
  • Try to make Validation Requests separately for each request.
  • Although PHP has a class named DateTime to help you when reading, writing, comparing or calculating with date and time. It is recommended that you use the Carbon Library for dealing with dates.
  • Always keep yourself updated with the latest version, Laravel is updating real fast, so keep up the pace.
  • Always use gulp, Laravel Mix for compiling your scripts and sass into minified version for better performance, Laravel did the basic housekeeping for you.

Feel free to add more to the list…

How to replace plain URLs with links in JavaScript or PHP?

Hello Friends

If you want to convert plain text in to URLs in JavaScript or PHP. This is good solution for you.

In PHP :

public function makeLinks($str)
{
    $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
    $urls = array();
    $urlsToReplace = array();
    if(preg_match_all($reg_exUrl, $str, $urls)) {
        $numOfMatches = count($urls[0]);
        $numOfUrlsToReplace = 0;
        for($i=0; $i<$numOfMatches; $i++) {
            $alreadyAdded = false;
            $numOfUrlsToReplace = count($urlsToReplace);
            for($j=0; $j<$numOfUrlsToReplace; $j++) {
                if($urlsToReplace[$j] == $urls[0][$i]) {
                    $alreadyAdded = true;
                }
            }
            if(!$alreadyAdded) {
                array_push($urlsToReplace, $urls[0][$i]);
            }
        }
        $numOfUrlsToReplace = count($urlsToReplace);
        for($i=0; $i<$numOfUrlsToReplace; $i++) {
            $str = str_replace($urlsToReplace[$i], "<a target='_balnk' href=\"".$urlsToReplace[$i]."\">".$urlsToReplace[$i]."</a> ", $str);
        }
        return $str;
    } else {
        return $str;
    }
}

In JavaScript

function makeLinks(text) {
 var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
 return text.replace(exp,"<a target='_blank' href='$1'>$1</a>");
}

Hope it helps.

8 Things Productive People Do During the Workday

8 Things Productive People Do During the Workday

Productivity

Forget about your job title or profession – everyone is looking for ways to be more productive at work. It’s time to set down your gallon-sized container of coffee, toss out your three-page to-do list, and put an end to those ridiculously long emails you’ve been sending.

Experiencing a highly productive workday can feel euphoric. But contrary to popular belief, simply checking tasks off your to-do list isn’t really an indication of productivity. Truly productive people aren’t focused on doing more things; this is actually the opposite of productivity. If you really want to be productive, you’ve got to make a point to do fewer things.

Harness your productivity by taking note of these eight things:

1. Create a smaller to-do list. Getting things accomplished during your workday shouldn’t be about doing as much as possible in the sanctioned eight hours. It may be hard to swallow, but there’s nothing productive about piling together a slew of tasks in the form of a checklist. Take a less-is-more approach to your to-do list by only focusing on accomplishing things that matter.

2. Take breaks. You know that ache that fills your brain when you’ve been powering through tasks for several hours? This is due to your brain using up glucose. Too many people mistake this for a good feeling, rather than a signal to take a break. Go take a walk, grab something to eat, workout, or meditate – give your brain some resting time. Achieve more productivity during your workday by making a point to regularly clear your head. You’ll come back recharged and ready to achieve greater efficiency.

3. Follow the 80/20 rule. Did you know that only 20 percent of what you do each day produces 80 percent of your results? Eliminate the things that don’t matter during your workday: they have a minimal effect on your overall productivity. For example, on a project, systematically remove tasks until you end up with the 20 percent that gets the 80 percent of results.

4. Start your day by focusing on yourself. If you begin your morning by checking your email, it allows others to dictate what you accomplish. Set yourself in the right direction by ignoring your emails and taking the morning to focus on yourself, eat a good breakfast, meditate, or read the news.

5. Take on harder tasks earlier in the day. Knock out your most challenging work when your brain is most fresh. Save your busy work – if you have any – for when your afternoon slump rolls in.

6. Pick up the phone. The digital world has created poor communication habits. Email is a productivity killer and usually a distraction from tasks that actually matter. For example, people often copy multiple people on emails to get it off their plate – don’t be a victim of this action. This distracts everyone else by creating noise against the tasks they’re trying to accomplish and is a sign of laziness. If you receive an email where many people are CC’d, do everyone a favor by BCCing them on your reply. If your email chain goes beyond two replies, it’s time to pick up the phone. Increase your productivity by scheduling a call.

7. Create a system. If you know certain things are ruining your daily productivity, create a system for managing them. Do you check your emails throughout the day? Plan a morning, afternoon, and evening time slot for managing your email. Otherwise, you’ll get distracted from accomplishing more important goals throughout the day.

8. Don’t confuse productivity with laziness. While no one likes admitting it, sheer laziness is the No. 1 contributor to lost productivity. In fact, a number of time-saving methods – take meetings and emails for example – are actually just ways to get out of doing real work. Place your focus on doing the things that matter most as efficiently and effectively as possible.

Remember, less is more when it comes to being productive during the workday.

What’s your secret to productive workdays?

 

Set php.ini Values Using .htaccess

Did you know that you can set php.ini values right inside the .htaccess file? It’s actually very easy.

The .htaccess Code

#format
php_value setting_name setting_value#example
php_value  upload_max_filesize  10M

Of course you could simply place these in the .htaccess file, but .htaccess is a viable alternative if your host doesn’t allow you to touch the php.ini file.

Resource :

http://davidwalsh.name/php-values-htaccess