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

Tutsplanet

Free Technical and Blogging Resources

  • Home
  • Web Hosting
  • Programming
  • Plugins
  • Write For US
  • News
  • About Us
  • Snippets

Add a New Column To Existing Table In a Migration Laravel

Feb 24, 2021 by

Step #1 Create the Migration php artisan make:migration add_middlename_to_users_table –table=users Step #2 Copy the below function and replace up function and down function. public function up() { Schema::table(‘users’, function($table) { $table->string(‘middlename’); }); } and also don’t forget to add the roll back option public function down() { Schema::table(‘users’, function($table) { $table->dropColumn(‘middlename’); }); } Step #3 […]

How To Save All Docker Images And Copy/Move To Another Host?

Feb 22, 2021 by

Follow  the below steps to export all docker images and import to another system. Step #1 Export or save all images to one tar file. docker save $(docker images –format ‘{{.Repository}}:{{.Tag}}’) -o allfilestoone.tar Step #2 From the other host load to docker docker load -i allfilestoone.tar

How to run specific migration in Laravel?

Feb 21, 2021 by

Use the below command to run only a selected migration. php artisan migrate –path=/database/migrations/migation_file.php

Truncate a table in Laravel

Feb 11, 2021 by

Using Eloquent User::truncate(); Using DB records DB::table(‘users’)->truncate();

How to set foreign key check to zero in Laravel?

Feb 9, 2021 by

DB::statement(‘SET FOREIGN_KEY_CHECKS=0’); Schema::drop(‘your table name’); ………….. ………….. DB::statement(‘SET FOREIGN_KEY_CHECKS=1’); Tested in Laravel 8.x

Start a PHP a server on Mac OS X

Feb 7, 2021 by

php -S localhost:9000

Get/Print raw SQL in Larvel?

Feb 4, 2021 by

DB::enableQueryLog(); // Enabling the query log // Write your Eloquent query here dd(DB::getQueryLog()); // Show the querry

Tagged With: Laravel

How to enable Word wrap in PHPStorm?

Sep 5, 2018 by

If you want to enable the text word wrapped in PHPStorm, go to  

How to yield a default value in Laravel Blade?

Sep 5, 2018 by

It’s very easy to yield a default value in Laravel blade, just follow the below code

How To Include A Partial Template in Blade

Aug 31, 2018 by

How to include blade template when it inside another blade template. Just use the below snippet in your blade code. <div class=”header”> @include(‘path/to/partial’) </div>  

How to list directories with size in Linux

Aug 30, 2018 by

Run the following to get the size of the directories in Linux. This is the short version of A bit of explanation for the commands. du : Disk Usage -s  : Display a summary for each specified file -h : Short of human readable.

mysqldump – Taking MySQL dump from another machine

Aug 30, 2018 by

When prompts password please input password.

How to get the current date and time in PHP?

Aug 29, 2018 by

Most simple format This will be returning based on the default server timezone. If you want to change the timezone and generate the time as per the timezone, use the below code. Call the date function, it will return according to the timezone.

How to check the version of Ubuntu via SSH?

Aug 29, 2018 by

Just run the below command in the command line Output In other way you can run the below command too Output

How to concatenate set of results in MySQL?

Aug 29, 2018 by

In this post we are discussing about how to join the results from a query with a comma seperate or a pipe whatever. Suppose I have a users table, and I need to show all this users name in a comman seperated format in one single line. name John Doe Kasper Jen The diresired output […]

Copy & Rename a File in a Directory – PHP

Aug 29, 2018 by

You can use PHP script to Copy & Rename a File in a Directory.We use copy PHP function to do this.

Laravel Eloquent – How to get the row count?

Aug 23, 2018 by

This simple code will give you the row count in Laravel Eloquent.

CSS border-radius property

Aug 23, 2018 by

Give a rounded corners to any element using the CSS border-radius property.

How to insert multiple rows in Laravel 5?

Aug 19, 2018 by

You can bulk insert to database table using either Eloquent or query builder in Laravel.

Primary Sidebar




Quick Links

  • A Simple YouTube Video Downloader Script in PHP
  • The 50 Most Useful jQuery Plugins for Frontend Development
  • Base64 Decode Online
  • Base64 Encode Online

Subscribe

* indicates required

Share

   

Hot topics

  • A Simple YouTube Video Downloader Script in PHP 248 views
  • Replace “\n” with new line characters, using Notepad++ 246 views
  • Add FTP/SFTP in Visual Studio Code 160 views
  • Open a URL in a new tab using JavaScript 136 views
  • Using Third-Party Libraries in Codeigniter 134 views
  • Hierarchical Tree view Category Example in Laravel 129 views
  • Upload Multiple Images and Store in Database using PHP and MySQL. 121 views
  • Laravel Image Intervention Tutorial With Example 110 views
  • How to change PHP version on MAMP – Mac OSX 101 views
  • Spout, an awesome library for reading and writing in Excel. 99 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 © 2021 · TutsPlanet Gene Theme on Genesis Framework · Powered By BunnyCDN