Put SearchTrait.php
in app
directory. Then use SearchTrait
in your model, like so
use App\SearchTrait;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
mkdir ~/app-root/data/tmp | |
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp//all.sql |
#!/usr/bin/env bash | |
GIT_DIR_SAVE=$GIT_DIR ; unset GIT_DIR | |
GIT_WORK_TREE_SAVE=$GIT_WORK_TREE ; unset GIT_WORK_TREE | |
if [ ! -f "${OPENSHIFT_DATA_DIR}composer/bin/composer" ]; then | |
export COMPOSER_HOME="${OPENSHIFT_DATA_DIR}.composer" | |
echo $COMPOSER_HOME > ${OPENSHIFT_HOMEDIR}.env/user_vars/COMPOSER_HOME | |
echo "Installing composer" | |
curl -s https://getcomposer.org/installer | env - PATH="/usr/bin:$PATH" php -- --install-dir=$OPENSHIFT_DATA_DIR >/dev/null |
MIT License | |
Copyright (c) 2014 Piotr Kuczynski | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR |
<?php | |
return array( | |
/* | |
|-------------------------------------------------------------------------- | |
| Validation Language Lines | |
|-------------------------------------------------------------------------- | |
| | |
| The following language lines contain the default error messages used by |
The connection failed because by default psql
connects over UNIX sockets using peer
authentication, that requires the current UNIX user to have the same user name as psql
. So you will have to create the UNIX user postgres
and then login as postgres
or use sudo -u postgres psql database-name
for accessing the database (and psql
should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres
(as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf
* line:
from
/** | |
* PHP's __call magic method is pretty useful. Unfortunately | |
* there is no equivalent in JavaScript, but it can be | |
* emulated with Proxy: | |
*/ | |
magicMethodsProxy = | |
{ | |
get: function(target, prop, receiver) | |
{ |
public function getdataforselect2(Request $request){ | |
if ($request->ajax()) { | |
$term = trim($request->term); | |
$posts = DB::table('channels')->select('id','name as text') | |
->where('name', 'LIKE', '%' . $term. '%') | |
->orderBy('name', 'asc')->simplePaginate(10); | |
$morePages=true; |