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 | | 3333 Viewer | Category : Laravel
READ MORE

    How to get location information from ip address in Laravel ?

    How to get location information from ip address in Laravel ?

    Open Post

    How to get gravatar image from email using Jquery?

    How to get gravatar image from email using Jquery?

    Open Post

    Laravel 5 - line chart example code using google charts API

    Laravel 5 - line chart example code using google charts API

    Open Post

    Jquery highlight search text in div using highlight JS with example

    Jquery highlight search text in div using highlight JS with example

    Open Post

    Laravel - How to search with comma separated values using Query Builder ?

    Laravel - How to search with comma separated values using Query Builder ?

    Open Post

    Laravel 5 mailchimp api integration from scratch with example

    Laravel 5 mailchimp api integration from scratch with example

    Open Post