Skip to content

Instantly share code, notes, and snippets.

@refo
Last active August 29, 2015 14:27
Show Gist options
  • Save refo/b9dade30f7cda809ba66 to your computer and use it in GitHub Desktop.
Save refo/b9dade30f7cda809ba66 to your computer and use it in GitHub Desktop.
Laravel 5 Snippets

Run sql dumps or exports

DB::unprepared(file_get_contents('/path/to/dump.sql'));

Query builder where clause operators

Defined in Illuminate/Database/Query/Builder.php

    protected $operators = [
        '=', '<', '>', '<=', '>=', '<>', '!=',
        'like', 'like binary', 'not like', 'between', 'ilike',
        '&', '|', '^', '<<', '>>',
        'rlike', 'regexp', 'not regexp',
        '~', '~*', '!~', '!~*', 'similar to',
                'not similar to',
    ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment