Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Laravel Drop All Tables & Migrate

php artisan migrate:fresh

php artisan migrate:fresh --seed
Comment

laravel softdelete migration

use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
 
Schema::table('flights', function (Blueprint $table) {
    $table->softDeletes();
});
 
Schema::table('flights', function (Blueprint $table) {
    $table->dropSoftDeletes();
});
Comment

laravel migration delete column

Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('table', function($table) {
             $table->dropColumn('coulmn_name');
          });
      }

      public function down()
      {
          Schema::table('table', function($table) {
             $table->integer('column_name');
          });
      }
  }
Comment

laravel drop table migration

Schema::drop('users');

Schema::dropIfExists('users');
Comment

delete a migration laravel

// delete a migration safely from laravel 
delete migration from database/migrations/ directory
and also delete entry from migrations table
Comment

delete rows by migration laravel

Comment::where('post_id',$id)->delete();

// in down migration

    public function down()
    {
        Schema::table('package_types', function (Blueprint $table) {
            AppModelsPackageType::query()->where('id','gt',1)->delete();
        });
    }
Comment

PREVIOUS NEXT
Code Example
Php :: how to run a php file using 
Php :: php overriding 
Php :: Best testing tools for php 
Php :: connect php to db 
Php :: Get class of an object variable php 
Php :: laravel collection only 
Php :: laravel create command tutorial 
Php :: oop in php 
Php :: laravel validation rule 
Php :: default time of session in php 
Php :: laravel auth gurd for login user 
Php :: check if a string contains a word 
Php :: how to develop package beside laravel project 
Php :: php interview questions for experience 
Php :: how to fetch data from database in php 
Php :: laravel return redirect back with input except one filed 
Php :: data XML 
Php :: Check Data Load More Laravel Livewire 
Php :: php normalize whitespace characters 
Php :: laravel gigapay delete payout 
Php :: function placing bet using php 
Php :: laravel postgres deadlock 
Php :: how to import Yomo in larave; 
Php :: tina4 save file to database in orm 
Php :: IlluminateDatabaseEloquentMassAssignmentException with message 
Php :: wc get_image() return image url 
Php :: file handling x+ in php example 
Php :: php blob to string 
Php :: How to return custom error message from controller method validation 
Php :: Who is known as the father of PHP? 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =