Tag : hasColumn


How to check column exists or not in table Laravel 5

When i was working my laravel application at that time i need to remove column from database. But i am not sure that column is exists or not in tables. So i was thinking, but i found solution from Laravel Database Migration Schema. we can check column is exists or not in tabales using hasColumn. If you also need to remove if column is exists then you can use bellow example. <strong>Example:</strong> <pre class="prettyprint lang-php"> if (Schema::hasColumn('subscriptions', 'stripe_id')) { Schema::table('subscriptions', function ($table) { $table->dropColumn('stripe_id'); }); } <.....

By Hardik Savani | May 4, 2016 | | 2245 Viewer | Category : Laravel
READ MORE

    AngularJS - How to render HTML value in ng-repeat ?

    AngularJS - How to render HTML value in ng-repeat ?

    Open Post

    Laravel 5.2 - User ACL Roles and Permissions with Middleware using entrust from Scratch Tutorial

    Laravel 5.2 - User ACL Roles and Permissions with Middleware using entrust from Scratch Tutorial

    Open Post

    How to make read more link from string in PHP?

    How to make read more link from string in PHP?

    Open Post

    Laravel 5 - Image Gallery CRUD example from scratch

    Laravel 5 - Image Gallery CRUD example from scratch

    Open Post

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 2

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 2

    Open Post

    PHP - multiple file uploading dropzone js example

    PHP - multiple file uploading dropzone js example

    Open Post