Created
July 6, 2019 16:21
-
-
Save nutch31/627fb9f6e54f9e1ce630f6c01101793b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Campaign extends Model | |
{ | |
// | |
protected $table = 'campaigns'; | |
protected $fillable = [ | |
'name', | |
'status', | |
'email', | |
'created_at', | |
'updated_at' | |
]; | |
/** | |
* @return \Illuminate\Database\Eloquent\Relations\HasMany | |
*/ | |
public function channels() | |
{ | |
return $this->hasMany('App\Channel'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Channel extends Model | |
{ | |
// | |
protected $table = 'channels'; | |
protected $fillable = [ | |
'campaign_id', | |
'name', | |
'status', | |
'analytic_campaign_id', | |
'tracking_phone', | |
'forward_phone', | |
'created_at', | |
'updated_at' | |
]; | |
/** | |
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | |
*/ | |
public function campaign() | |
{ | |
return $this->belongsTo('App\Campaign'); | |
} | |
/** | |
* @return \Illuminate\Database\Eloquent\Relations\HasMany | |
*/ | |
public function leads() | |
{ | |
return $this->hasMany('App\Lead'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Lead extends Model | |
{ | |
// | |
const LANDING_PAGE_SYSTEM = 'landing page'; | |
const PHONE_SYSTEM = 'pbx'; | |
const TYPE_SUBMITTED = 'submitted'; | |
const TYPE_ANSWERED = 'answered'; | |
const TYPE_MISSED_CALL = 'missed_call'; | |
const NOT_CONTENT = [ | |
'token', | |
'channel_id', | |
'name', | |
'email', | |
'phone', | |
'ip_address', | |
'page_url' | |
]; | |
protected $table = 'leads'; | |
protected $fillable = [ | |
'channel_id', | |
'type', | |
'submitted_date_time', | |
'form_name', | |
'form_email', | |
'form_phone', | |
'form_content', | |
'form_ip_address', | |
'form_page_url', | |
'call_phone', | |
'call_status', | |
'call_recording_url', | |
'call_forward_phone', | |
'is_duplicated', | |
'parent_id', | |
'created_at', | |
'updated_at' | |
]; | |
/** | |
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | |
*/ | |
public function channel() | |
{ | |
return $this->belongsTo('App\Channel'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment