File: /home/imensosw/www/mpl.imenso.co/app/Models/Connection.php
<?php
namespace App\Models;
use Carbon\Carbon as Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Connection extends Model
{
public static function addNew($data)
{
if (DB::table(static::$connection_table)->where($data)->count() == 0) {
$data['created_at'] = Carbon::now()->format('Y-m-d H:i:s');
$data['updated_at'] = Carbon::now()->format('Y-m-d H:i:s');
DB::table(static::$connection_table)->insert($data);
}
}
}