Laravel Framework Cheat Sheet

Get laravel app base urbottom: 0px !important;border-top-width: 0px !important;

$app->make('url')->to('/');

$app['url']->to('/');

App::make('url')->to('/');

Laravel Scheduler – Cron Tutorial

Task scheduling is an important part of many web applications.

Here are several examples:

  • Check if new emails are received in a specified email accounts inbox, read them and take actions based on the information ( in every minute)
  • Perform batch jobs – etc dispatch order status change emails in an ecommerce system. (once a hour )
  • Clear logs ( once a day )

Laravel makes it super easy and intuitive to use linux CRON scheduler  to perform automated tasks for your web application.

Usually web applications achieve task scheduling by creating several cron jobs in Linux  that execute the required controller methods in the web application. Downside of this approach is that you need to create one cron job for each task.  So if there are 10 tasks , you have to create 10 cron jobs in Linux making it hard to manage.

Laravel adds a layer of programmable logic between the operating system and your web application that you can program your tasks with specified time interval to run them and use a single CRON job .

So once you create general cron job that invokes the laravel scheduler, you are free to programmatically add any number of tasks to run on various time intervals. There are many commonly used time intervals which can be accessed via easy to remember method names such as ->everyMinute(); which obviously runs a given task every minute.

TO be continued. Please provide your feedback below.

PHP7 Vulnerability that allows hackers to hijack web servers

The PHP programming language that powers most of the Internet based appications. It is used in the popular content management systems like WordPress, Joomla and Drupal, so it’s a big issue  whenever someone identify a security vulnerability within it.

A few days a ago, Emil ‘Neex’ Lerner, a Russian security expert, published a remote-code execution vulnerability in PHP version 7.

With this vulnerability,  an attacker could force a remote web server to execute their own random code just by entering a crafted URL. The attacker only needs to add “?a=” to the website address, followed by their code payload.

This attack makes it very easy to  start hacking a website,  so that even a non-technical user could abuse it.

Fortunately, the vulnerability only affects servers using the NGINX web server with the PHP-FPM extension. PHP-FPM is a modded version of FastCGI, with a several additional features intended for websites with high traffic.

Due to the availability of public sample ( POC) code and the extreme simplicity of exploiting this bug, website owners are advised to check server settings and update PHP as soon as possible if they run the vulnerable configuration.

Read More at : ZDNET

All About Site Kit by Google WordPress Plugin

Site Kit by Google is a plugin that brings all the Google related services for any WordPress website under a single dashboard.  It is so well made that it is extremely easy to install, configure and use.

It allows following Google Products and Services to be accessed from within your WordPress dashboard in a very intutive user interface.

Google Search Console

Google Search Console is a web service by Google which allows webmasters to check indexing status and optimize visibility of their websites.

Google AdSense

Google AdSense is a program run by Google through which website publishers in the Google Network of content sites serve text, images, video, or interactive media advertisements that are targeted to the site content and audience

Google Analytics

Google Analytics is a web analytics service offered by Google that tracks and reports website traffic, currently as a platform inside the Google Marketing Platform brand

PageSpeed Insight

PageSpeed Insights (PSI) reports on the performance of a page on both mobile and desktop devices, and provides suggestions on how that page may be improved.

Tag Manager

Tag Manager creates an easy to manage way to create tags on your site without updating code.

Optimize

Create free A/B tests that help you drive metric-based design solutions to your site.

Installing Site Kit by Google WordPress Plugin

Installation is as easy as any other WP Plugin.

Confuguring Site Kit by Google WordPress Plugin

Just have to login to your Google Account when prompted to do so, and allow relavant permisions for your website. Then thats it!

How to check the Laravel version using CLI / command prompt and files on Windows or Linux

[vc_row][vc_column][vc_column_text]There are two ways to find the version of your Laravel application . You can either find it by running a command via CLI/ Command Prompt or you can check Laravel version in source files of your Laravel installation.[/vc_column_text][vc_tabs][vc_tab title=”Using Command” tab_id=”1572406098-1-97″][vc_column_text title=”Using command line CLI / Command prompt to find Laravel version” css=”.vc_custom_1572400844663{margin-bottom: 0px !important;}”]Open the terminal / cmd on your system. Now change directory to the web root directory of the Laravel installation and then run the following command to check the Laravel version.[/vc_column_text][mk_padding_divider size=”20″][vc_single_image image=”8915″ img_size=”full” onclick=”link_image”][mk_fancy_title size=”20″ margin_top=”20″ margin_bottom=”0″ font_family=”none”]On Linux[/mk_fancy_title][vc_column_text css=”.vc_custom_1572406835275{margin-bottom: 0px !important;}”]

$php artisan --version

[/vc_column_text][mk_padding_divider size=”20″][mk_fancy_title size=”20″ letter_spacing=”” margin_top=”20″ margin_bottom=”0″ font_family=”none”]On Winows[/mk_fancy_title][vc_column_text css=”.vc_custom_1572406843857{margin-bottom: 0px !important;}”]

c:\xampp\htdocs\laravel_application>php artisan --version

[/vc_column_text][mk_fancy_title size=”20″ margin_top=”20″ margin_bottom=”0″ font_family=”none”]How to check laravel version of a project[/mk_fancy_title][vc_column_text title=”Using command line CLI / Command prompt to find Laravel version” css=”.vc_custom_1576079694183{margin-bottom: 0px !important;}”]You could use either of two methods described above, using terminal/CMD or by inpecting the source files. Please comment if you face any problems following the instructions. We will try to help as fast as we can.[/vc_column_text][/vc_tab][vc_tab title=”Using Source Files” tab_id=”1572406098-2-75″][vc_single_image image=”8922″ img_size=”full” onclick=”link_image”][vc_column_text css=”.vc_custom_1572406696655{margin-bottom: 0px !important;}”]

Open below file in your laravel system using your favourit text editor.

/vendor/laravel/framework/src/Illuminate/Foundation/Application.php

[/vc_column_text][mk_fancy_title size=”20″ margin_top=”20″ margin_bottom=”0″ font_family=”none”]Find laravel version using source files[/mk_fancy_title][/vc_tab][/vc_tabs][/vc_column][/vc_row][vc_row][vc_column][mk_padding_divider size=”20″][/vc_column][/vc_row][vc_row][vc_column][mk_padding_divider][vc_column_text css=”.vc_custom_1572405501990{margin-bottom: 0px !important;}”]

History of Laravel Releases

VersionReleaseBug Fixes UntilSecurity Fixes Until
V1June 2011
V2September 2011
v3February 2012
v4May 2013
5.0Feb 4th, 2015Aug 4th, 2015Feb 4th, 2016
5.1 (LTS)Jun 9th, 2015Jun 9th, 2017Jun 9th, 2018
5.2Dec 21st, 2015Jun 21st, 2016Dec 21st, 2016
5.3Aug 23rd, 2016Feb 23rd, 2017Aug 23rd, 2017
5.4Jan 24th, 2017Jul 24th, 2017Jan 24th, 2018
5.5 (LTS)Aug 30th, 2017Aug 30th, 2019Aug 30th, 2020
5.6Feb 7th, 2018Aug 7th, 2018Feb 7th, 2019
5.7Sep 4, 2018Feb 4th, 2019Sep 4th, 2019
5.8Feb 26th, 2019Aug 26th, 2019Feb 26th, 2020
6.0 (LTS)Sept 3rd, 2019Sept 3rd, 2021Sept 3rd, 2022

[/vc_column_text][vc_column_text css=”.vc_custom_1572405742781{margin-bottom: 0px !important;}”]More in for about versions : https://laravel-news.com/laravel-release-process

[/vc_column_text][/vc_column][/vc_row]

How to set a static front page for my WordPress blog / website?

Step 1 – Create or select a WordPress Page

First step is to create the new page. if you want to select an existing page, thats fine too.

To create a new page, goto WordPress admin area -> Pages -> Add New.

Once you have created and saved the new page, you are ready to set it as the websites front page.

Go to Settings -> Reading.

Step 2 – Set the selected page as the WordPress Home page

Go to Settings -> Reading.

Once there, tick “A static page (select below)” in the “Front page displays” section.
Then from the “Front page” drop-down menu choose the static page you wish to make as home page and click Save Changes.

Now browse your home page and verify everything is in order.
(You might want to clear WordPress cache if you are using any cache plugins to see the change. )

Redirect from HTTPS to HTTP – Force HTTP

There are some  scenarios when you want to redirect a website address to be opened through HTTP instead of HTTPS.
To do that,  you can add the following htaccess directives  in your website’s .htaccess file:

 

What is the Difference Between Vision and Mission Statements of a Business

The vision statement focuses on the future and what the organization wants to become. The mission statement focuses on the present and what the organization does. While organizations generally use mission and vision statements conversely, it’s essential to have both of them. Just one doesn’t work without the other, because having a purpose and meaning are crucial for any business to succeed.

The Mission Statement 

Your mission statement drives the company. It is what you do at the core of the business, and it defines the objectives and finally, it also defines the means to reach those objectives. It also shapes your company’s culture and gives it a personality.

A mission statement may answer questions like:

  • What do we do?
  • Whom do we serve?
  • How do we serve them?

The vision statement?

Your vision statement provides the company direction. It is the future of the business, which then provides the purpose for the business

The vision statement is your aspirations, what you want to become to be successful.

A vision statement may look like:

  • What are our hopes and dreams?
    What problem are we solving for the greater good ?
    Who and what are we aspiring to change?