/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $apis = ['MailChimp', 'GetResponse', 'iContact', 'Infusionsoft', 'Madmimi', 'AWeber', 'Constant Contact'];
     foreach ($apis as $ap) {
         $api = Api::where('name', '=', $ap)->first();
         if (!$api) {
             Api::create(['name' => $ap]);
         }
     }
 }
Beispiel #2
0
 public static function findByKey($key)
 {
     $user_id = Api::where('api_key', $key)->value('user_id');
     if ($user_id === null) {
         return;
     }
     return static::find($user_id);
 }