• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Tutsplanet

Tutsplanet

Free Technical and Blogging Resources

  • Home
  • Web Hosting
  • Programming
  • Plugins
  • Twitter Trends
  • Tools
  • About Us

Snippets List

Snippets List TagsLaravel

Laravel date set timezone

Feb 3, 2021 Editorial Staff

In ‘timezone’ => ‘Asia/Kolkata’ Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add custom CSS to head section in Magento 1 ?Append an…Continue Reading

Snippets List

How to create console command in laravel ?

Feb 3, 2021 Editorial Staff

php artisan make:command CommandNameFile Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add custom CSS to head section in Magento 1 ?Append an…Continue Reading

Snippets List

Show a number in two decimal places in PHP

Feb 1, 2021 Editorial Staff

$number = “105”; echo number_format($number, 2, ‘.’, ”); Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add custom CSS to head section in…Continue Reading

PHP, Snippets List

PHP str_replace() Function

Oct 22, 2019 Editorial Staff Leave a Comment

replaces all occurrences of search string with a replacement string. Syntax str_replace(find, replace, string, count) find(required) – It specifies the value to find. replace(required) – It specifies the value to replace the value in find. string(required) – it specifies the string to be searched. count(optional) – it is the variable that counts the number of…Continue Reading

Snippets List

How to delete file from public folder in Laravel?

Aug 14, 2018 Editorial Staff Leave a Comment

Delete a single File $filename = public_path(‘avatars’).’/photo.jpg’; File::delete($filename); Delete multiple files $data = array($filename1, $filename2); File::delete($data); Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How…Continue Reading

Snippets List

How to run Laravel validation if the field is not empty?

Aug 14, 2018 Editorial Staff Leave a Comment

You can simply use sometimes|nullable in the validation rules. It is a best practice for validating optional fields. Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not…Continue Reading

Snippets List

How to add custom CSS to head section in Magento 1 ?

Aug 13, 2018 Editorial Staff Leave a Comment

There is two ways to add a custom css to head section in Magento 1 <action method=”addCss”> <stylesheet>css/custom.css</stylesheet> </action> OR <action method=”addItem”> <type>skin_css</type> <name>css/custom.css</name> </action> Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to…Continue Reading

Snippets List TagsjQuery

Append an element with fade in effect in jQuery

Aug 13, 2018 Editorial Staff Leave a Comment

You can do this by using append function in jQuery as below snippet $(‘#main_conatiner’).append( $(‘<p><img src=”loader.gif”></p>’).hide().fadeIn(2000) ); Or you can use appendTo function as below var html ='<p><img src=”loader.gif”></p>’; $(html).hide().appendTo(“#main_conatiner”).fadeIn(2000); Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from…Continue Reading

Snippets List

jQuery: How to fix div when browser scrolls?

Aug 12, 2018 Editorial Staff 2 Comments

How to fix div when browser scrolls using JQuery Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add custom CSS to head section…Continue Reading

General, Snippets List

How to select specific columns in laravel eloquent ORM?

Aug 8, 2018 Editorial Staff Leave a Comment

Model::select(‘field1′,’field2’)->where(‘type’, ‘post’)->get()

Programming, Snippets List

How to remove file preview on the right side of Visual Studio Code Editor

Aug 7, 2018 Editorial Staff Leave a Comment

Click on the View menu and look for Toggle Minimap, switch that off.

Snippets List TagsMySql

How to change the default collation of a database?

Aug 7, 2018 Editorial Staff Leave a Comment

To Change the entire database’s collation, just run the below query. Or Change collation of just one table Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is…Continue Reading

PHP, Programming, Snippets List

How to get all days and date for a given month?

Aug 5, 2018 Editorial Staff Leave a Comment

This is to get all days and date for choosen month. Just follow the code to display all the dates for a month. $month = “07”; $year = “2018”; $startDate = “01-“.$month.”-“.$year; $startTime = strtotime($startDate); $endTime = strtotime(“+1 month”, $startTime); for($i=$startTime; $i<$endTime; $i+=86400) { $list[] = date(‘Y-m-d-D’, $i); } print_r($list);

Programming, Snippets List

Magento1: Get list of all Categories

Jul 31, 2018 Editorial Staff Leave a Comment

In Magento there are many ways to get the categories. In this snippet we are showing different method to display categories.

Snippets List

Display All WordPress Posts in One Page with Template Code

Jul 29, 2018 Editorial Staff Leave a Comment

How to display all posts in WordPress blog. You may have noticed the posts_per_page set as -1. This do the trick to pull all the posts from WordPress DB. Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public…Continue Reading

Programming, Snippets List TagsMagento

Magento 1: How to get the Order Id from Shipping Tracking Id

Jul 26, 2018 Editorial Staff Leave a Comment

How to get the Order Id from Shipping Tracking Id. This code would work only if the shipment has created.

Snippets List

How to get all images of product in Magento 1?

Jul 22, 2018 Editorial Staff Leave a Comment

Use the following code to get the images for a product in Magento 1. This code snippet will help you get the gallery images for a product in Magento 1. Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from…Continue Reading

Programming, Snippets List TagsMagento1

Magento – get product id by sku

Jul 17, 2018 Editorial Staff Leave a Comment

To get the product id from the SKU in magento1 $sku = 90909; // use your sku $productId = Mage::getModel(“catalog/product”)->getIdBySku( $sku );

Snippets List

How to remove all CSS classes using jQuery?

Mar 22, 2018 Editorial Staff Leave a Comment

How to remove all CSS classes for an element instead of removing it individually. Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add…Continue Reading

Snippets List

How to use DB query builder toArray() laravel 5?

Feb 27, 2018 Editorial Staff Leave a Comment

DB::table(‘document_attribute_values’)->get()->toArray(); Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add custom CSS to head section in Magento 1 ?Append an element with fade…Continue Reading

Snippets List

How to add new methods to a resource controller in Laravel?

Feb 27, 2018 Editorial Staff Leave a Comment

You can just add a route to that method separately, but before you call the resource controller route. Route::get(‘foo/bar’, ‘[email protected]’); Route::resource(‘foo’, ‘FooController’); Note:Your new methods have to go above the ::resource line Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete…Continue Reading

Snippets List

How to insert multiple rows from a single query using query builder?

Feb 27, 2018 Editorial Staff Leave a Comment

It’s really easy to do a bulk insertion of rows in Laravel using arrays. $data = array( array(‘user_id’=>’User 01′, ’email’=> ‘[email protected]’), array(‘user_id’=>’User 02′, ’email’=> ‘[email protected]’), ); DB::table(‘table’)->insert($data); // Query Builder Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder…Continue Reading

Snippets List

How to show all PHP errors and warnings?

Feb 27, 2018 Editorial Staff Leave a Comment

You can try the following code at the starting point of your php file. ini_set(‘display_errors’, 1); ini_set(‘display_startup_errors’, 1); error_reporting(E_ALL); Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field…Continue Reading

Snippets List

Why you should not use mysql_* functions anymore?

Feb 27, 2018 Editorial Staff Leave a Comment

There are several reasons for that 1) it is deprecated 2) It is not included in the PHP 7.0 anymore 3) It is not under active development 4) No support for transactions and stored proceedures Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace()…Continue Reading

Snippets List

What is the difference between ‘git pull’ and ‘git fetch’?

Feb 27, 2018 Editorial Staff Leave a Comment

If say simple git pull does a git fetch followed by a git merge. Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add custom CSS to head section…Continue Reading

Snippets List

Best web based easy to use MySQL database management tools?

Feb 27, 2018 Editorial Staff Leave a Comment

phpMyAdmin Adminer Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How to add custom CSS to head section in Magento 1 ?Append an element with…Continue Reading

Snippets List

How to check if an element is hidden in jQuery?

Jan 16, 2018 Editorial Staff Leave a Comment

If you want to check an element is hidden in on page using jQuery, it’s worth checking below code. $(yourelement).is(“:visible”); Same time you can use the below code for checking the same. $(‘element:hidden’)Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete…Continue Reading

Snippets List

How to get current page URL in PHP?

Jan 16, 2018 Editorial Staff Leave a Comment

You can use PHP $SERVER variable for getting current page URL. Being super global variable you will get access to $SERVER in any part of PHP application. Below is a sample script getting the URL of the current page in PHP <?php $uripart = $_SERVER[‘REQUEST_URI’]; $protocol = ((!empty($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] != ‘off’) || $_SERVER[‘SERVER_PORT’] ==…Continue Reading

Snippets List

jQuery hide() and show()

Jan 14, 2018 Editorial Staff Leave a Comment

Using jQuery, you can hide and show HTML elements with the hide() and show() methods: $(“#hide_btn”).click(function(){ $(“p”).hide(); }); $(“#show_btn”).click(function(){ $(“p”).show(); });Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the…Continue Reading

Snippets List

How can I refresh a page with javascript?

Jan 13, 2018 Editorial Staff Leave a Comment

location.reload(); In jQuery you can trigger an event and call this same function $(‘#divid’).click(function() { location.reload(); });Laravel date set timezoneHow to create console command in laravel ?Show a number in two decimal places in PHPPHP str_replace() FunctionHow to delete file from public folder in Laravel?How to run Laravel validation if the field is not empty?How…Continue Reading

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Primary Sidebar

Quick Links

  • Top 21 Website Ideas To Make Money Online in 2021
  • A Simple YouTube Video Downloader Script in PHP
  • The 50 Most Useful jQuery Plugins for Frontend Development
  • Replace “\n” with new line characters, using Notepad++
  • Using Third-Party Libraries in Codeigniter
  • Upload Multiple Images and Store in Database using PHP and MySQL.
  • Hierarchical Tree view Category Example in Laravel
  • Laravel Image Intervention Tutorial With Example
  • How to import sql file in MySQL database using PHP?
  • Free VAT Calculator Online

Subscribe

* indicates required



Search Here

Share

   



Hot topics

  • Replace “\n” with new line characters, using Notepad++ 15 views
  • Solution: windows photo viewer opens each time save a pic file 11 views
  • A Simple YouTube Video Downloader Script in PHP 10 views
  • How to Create PDF File From HTML Form Using Fpdf? 9 views
  • How to create and download a Zip file with PHP 8 views
  • Simple PHP Shopping Cart 7 views
  • How to set up GitHub SSH in Ubuntu with example 7 views
  • How to enter new line in Microsoft Teams? 7 views
  • Laravel Eloquent Select Column as Alias 7 views
  • Open a URL in a new tab using JavaScript 7 views

Categories

  • Design & Development
  • Drupal
  • Facebook
  • General
  • How To
  • ios
  • Javascript
  • Linux
  • Magento
  • Marketing
  • News
  • PHP
  • Plugins
  • Programming
  • Snippets List
  • Social Media
  • Softwares
  • Themes
  • Tips
  • Wordpress
  • YouTube























Copyright © 2023 · Planet on Genesis Framework · Powered By BunnyCDN . Network wallpapernoon.com