First commit
This commit is contained in:
22
app/Models/Banks.php
Normal file
22
app/Models/Banks.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\Suppliers;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Banks extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'code',
|
||||
'name',
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->hasMany(Suppliers::class);
|
||||
}
|
||||
}
|
||||
18
app/Models/Cards.php
Normal file
18
app/Models/Cards.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Cards extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'token',
|
||||
];
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
40
app/Models/Categories.php
Normal file
40
app/Models/Categories.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\Suppliers;
|
||||
use App\Models\Postulations;
|
||||
use App\Models\CurrentContracts;
|
||||
use App\Models\FinishedContracts;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Categories extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'en_name'
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->hasMany(Suppliers::class);
|
||||
}
|
||||
|
||||
public function postulations()
|
||||
{
|
||||
return $this->hasMany(Postulations::class);
|
||||
}
|
||||
|
||||
public function currentcontracts()
|
||||
{
|
||||
return $this->hasMany(CurrentContracts::class);
|
||||
}
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->hasMany(FinishedContracts::class);
|
||||
}
|
||||
}
|
||||
29
app/Models/Coupon.php
Normal file
29
app/Models/Coupon.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Models\CurrentContracts;
|
||||
use App\Models\FinishedContracts;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Coupon extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'percentage',
|
||||
'amount',
|
||||
'limit',
|
||||
'expire_at',
|
||||
];
|
||||
|
||||
public function currentcontracts()
|
||||
{
|
||||
return $this->hasMany(CurrentContracts::class);
|
||||
}
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->hasMany(FinishedContracts::class);
|
||||
}
|
||||
}
|
||||
64
app/Models/CurrentContracts.php
Normal file
64
app/Models/CurrentContracts.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\Categories;
|
||||
use App\Models\Suppliers;
|
||||
use App\Models\Coupon;
|
||||
use App\Models\Status;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
||||
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
||||
|
||||
class CurrentContracts extends Model
|
||||
{
|
||||
//
|
||||
use HasSpatial;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'supplier_id',
|
||||
'category_id',
|
||||
'address',
|
||||
'int_number',
|
||||
'references',
|
||||
'appointment',
|
||||
'amount',
|
||||
'details',
|
||||
'code',
|
||||
'coupon_id',
|
||||
'transaction_id',
|
||||
'status_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'location' => LocationCast::class
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Categories', 'category_id');
|
||||
}
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Suppliers', 'supplier_id');
|
||||
}
|
||||
|
||||
public function coupon()
|
||||
{
|
||||
return $this->belongsTo(Coupon::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
|
||||
}
|
||||
83
app/Models/FinishedContracts.php
Normal file
83
app/Models/FinishedContracts.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\Categories;
|
||||
use App\Models\Suppliers;
|
||||
use App\Models\Coupon;
|
||||
use App\Models\Status;
|
||||
use App\Models\Report;
|
||||
use App\Models\Payments;
|
||||
use App\NoHome;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
||||
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
||||
|
||||
class FinishedContracts extends Model
|
||||
{
|
||||
//
|
||||
use HasSpatial;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'supplier_id',
|
||||
'category_id',
|
||||
'address',
|
||||
'int_number',
|
||||
'references',
|
||||
'appointment',
|
||||
'amount',
|
||||
'details',
|
||||
'code',
|
||||
'coupon_id',
|
||||
'transaction_id',
|
||||
'score',
|
||||
'status_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'location' => LocationCast::class
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Categories', 'category_id');
|
||||
}
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Suppliers', 'supplier_id');
|
||||
}
|
||||
|
||||
public function coupon()
|
||||
{
|
||||
return $this->belongsTo(Coupon::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
|
||||
public function payments()
|
||||
{
|
||||
return $this->hasOne(Payments::class);
|
||||
}
|
||||
|
||||
public function reports()
|
||||
{
|
||||
return $this->hasOne(Report::class);
|
||||
}
|
||||
|
||||
public function nohome()
|
||||
{
|
||||
return $this->hasOne(NoHome::class);
|
||||
}
|
||||
|
||||
}
|
||||
18
app/Models/LinkedSocialAccount.php
Normal file
18
app/Models/LinkedSocialAccount.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LinkedSocialAccount extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'provider_name',
|
||||
'provider_id',
|
||||
];
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
34
app/Models/Payments.php
Normal file
34
app/Models/Payments.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\FinishedContracts;
|
||||
use App\Models\Suppliers;
|
||||
use App\Models\Status;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Payments extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'contract_id',
|
||||
'supplier_id',
|
||||
'amount',
|
||||
'status_id',
|
||||
];
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->belongsTo(FinishedContracts::class);
|
||||
}
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->belongsTo(Suppliers::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
}
|
||||
54
app/Models/Postulations.php
Normal file
54
app/Models/Postulations.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\Categories;
|
||||
use App\Models\Suppliers;
|
||||
use App\Models\Status;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
||||
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
||||
|
||||
class Postulations extends Model
|
||||
{
|
||||
//
|
||||
use HasSpatial;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'category_id',
|
||||
'address',
|
||||
'int_number',
|
||||
'references',
|
||||
'appointment',
|
||||
'amount',
|
||||
'details',
|
||||
'status_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'location' => LocationCast::class
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Categories', 'category_id');
|
||||
}
|
||||
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->hasMany(Suppliers::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
}
|
||||
32
app/Models/Status.php
Normal file
32
app/Models/Status.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\FinishedContracts;
|
||||
use App\Models\CurrentContracts;
|
||||
use App\Models\Payments;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Status extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'name',
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function currentcontracts()
|
||||
{
|
||||
return $this->hasMany(CurrentContracts::class);
|
||||
}
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->hasMany(FinishedContracts::class);
|
||||
}
|
||||
public function payments()
|
||||
{
|
||||
return $this->hasMany(Payments::class);
|
||||
}
|
||||
}
|
||||
80
app/Models/Suppliers.php
Normal file
80
app/Models/Suppliers.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\iChambaParameter;
|
||||
use App\Models\Banks;
|
||||
use App\Models\Categories;
|
||||
use App\Models\Postulations;
|
||||
use App\Models\FinishedContracts;
|
||||
use App\Models\CurrentContracts;
|
||||
use App\Models\Payments;
|
||||
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
||||
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Suppliers extends Model
|
||||
{
|
||||
use HasSpatial;
|
||||
|
||||
protected $fillable = [
|
||||
'company_name',
|
||||
'membership',
|
||||
'cover_photo',
|
||||
'tags',
|
||||
'RFC',
|
||||
'CURP',
|
||||
'clabe',
|
||||
'bank_id',
|
||||
'IVA_id',
|
||||
'ISR_id',
|
||||
'finished_jobs',
|
||||
'total_score',
|
||||
'address',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'location' => LocationCast::class
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function banks()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Banks', 'bank_id');
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
return $this->belongsToMany(Categories::class);
|
||||
}
|
||||
|
||||
public function postulations()
|
||||
{
|
||||
return $this->belongsToMany(Postulations::class)->withTimestamps();
|
||||
}
|
||||
|
||||
public function payments()
|
||||
{
|
||||
return $this->hasMany(Payments::class);
|
||||
}
|
||||
|
||||
public function currentcontracts()
|
||||
{
|
||||
return $this->hasMany(CurrentContracts::class);
|
||||
}
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->hasMany(FinishedContracts::class);
|
||||
}
|
||||
|
||||
public function ichambaparameters()
|
||||
{
|
||||
return $this->belongsTo(iChambaParameter::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user