Tag : is_null


How to check if record exists or not in Laravel 5?

If you are new in laravel 5 and you want to determine email is exist or not then you can do it easily. IF you did use code php then we have to write long code and check but laravel provide it's own query builder so it is pretty easy. you can see following example how i check row is exists or not: <strong class="example">Example:</strong> <pre class="prettyprint lang-php"> $user = User::where('email',Input::get('email'))->first(); if (is_null($user)) { print_r("email is exists"); } print_r("email is not exists"); </pre>

By Hardik Savani | April 13, 2016 | | 15695 Viewer | Category : Laravel
READ MORE

    Laravel 5 - whereIn and whereNotIn with subquery example using query builder

    Laravel 5 - whereIn and whereNotIn with subquery example using query builder

    Open Post

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

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

    Open Post

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Open Post

    Laravel 5.3 Image Upload with Validation example

    Laravel 5.3 Image Upload with Validation example

    Open Post

    Laravel 5 - Simple user access control using Middleware

    Laravel 5 - Simple user access control using Middleware

    Open Post

    Angularjs nl2br(textarea newline and linebreak conversion) example with demo

    Angularjs nl2br(textarea newline and linebreak conversion) example with demo

    Open Post