Initial commit
This commit is contained in:
10
app/Models/Balance.php
Executable file
10
app/Models/Balance.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Balance extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
30
app/Models/Merchant.php
Executable file
30
app/Models/Merchant.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Merchant extends Model
|
||||
{
|
||||
//
|
||||
// protected $fillable = [
|
||||
// 'fullname', 'phone', 'pin','country', 'language', 'org_id'
|
||||
// ];
|
||||
protected $guarded = [
|
||||
'id'
|
||||
];
|
||||
|
||||
public function transactions()
|
||||
{
|
||||
return $this->hasMany('App\Models\Transaction', 'merchant_id', 'id')->orderBy('created_at','desc')->take(10);
|
||||
}
|
||||
|
||||
public function topups()
|
||||
{
|
||||
return $this->hasMany('App\Models\Topup', 'merchant_id', 'id')->orderBy('created_at','desc')->take(10);
|
||||
}
|
||||
public function orgInfo()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Organisation', 'org_id', 'id');
|
||||
}
|
||||
}
|
||||
29
app/Models/MerchantToDealerRefund.php
Normal file
29
app/Models/MerchantToDealerRefund.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MerchantToDealerRefund extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $guarded = [
|
||||
'id'
|
||||
];
|
||||
|
||||
public $table = "merchant_to_dealer_refunds";
|
||||
|
||||
public function merchantInfo()
|
||||
{
|
||||
return $this->hasOne('App\Models\Merchant', 'id', 'merchant_id');
|
||||
}
|
||||
public function orgUserInfo()
|
||||
{
|
||||
return $this->hasOne('App\Models\OrgUser', 'id', 'dealer_id');
|
||||
}
|
||||
public function orgInfo()
|
||||
{
|
||||
return $this->hasOne('App\Models\Organisation', 'id', 'dealer_id');
|
||||
}
|
||||
}
|
||||
25
app/Models/MerchantTopUp.php
Normal file
25
app/Models/MerchantTopUp.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MerchantTopUp extends Model
|
||||
{
|
||||
public $table = "merchant_top_ups";
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function merchantInfo()
|
||||
{
|
||||
return $this->hasOne('App\Models\Merchant', 'id', 'merchant_id');
|
||||
}
|
||||
public function orgUserInfo()
|
||||
{
|
||||
return $this->hasOne('App\Models\OrgUser', 'id', 'org_user_id');
|
||||
}
|
||||
public function orgInfo()
|
||||
{
|
||||
return $this->hasOne('App\Models\Organisation', 'id', 'org_id');
|
||||
}
|
||||
}
|
||||
11
app/Models/ModelsSettings.php
Normal file
11
app/Models/ModelsSettings.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ModelsSettings extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
16
app/Models/OrgUser.php
Executable file
16
app/Models/OrgUser.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrgUser extends Model{
|
||||
|
||||
public $table = "org_users";
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function org_info(){
|
||||
return $this->hasOne('App\Models\Organisation', 'id', 'org_id');
|
||||
// return $this->belongsTo(Organisation::class);
|
||||
}
|
||||
}
|
||||
22
app/Models/Organisation.php
Executable file
22
app/Models/Organisation.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Organisation extends Model
|
||||
{
|
||||
|
||||
protected $guarded = [
|
||||
'id'
|
||||
];
|
||||
|
||||
public function orgUserInfo()
|
||||
{
|
||||
return $this->hasMany('App\Models\OrgUser', 'org_id', 'id');
|
||||
}
|
||||
public function userInfo()
|
||||
{
|
||||
return $this->hasOne('App\User', 'id', 'user_id');
|
||||
}
|
||||
}
|
||||
21
app/Models/OrganisationTopUp.php
Normal file
21
app/Models/OrganisationTopUp.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrganisationTopUp extends Model
|
||||
{
|
||||
public $table = "organisation_top_ups";
|
||||
protected $guarded = [
|
||||
'id'
|
||||
];
|
||||
public function orgInfo()
|
||||
{
|
||||
return $this->hasOne('App\Models\Organisation', 'id', 'org_id');
|
||||
}
|
||||
public function UserInfo()
|
||||
{
|
||||
return $this->hasOne('App\User', 'id', 'user_id');
|
||||
}
|
||||
}
|
||||
10
app/Models/Reseller.php
Executable file
10
app/Models/Reseller.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Reseller extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
10
app/Models/Service.php
Executable file
10
app/Models/Service.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Service extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
16
app/Models/Settings.php
Normal file
16
app/Models/Settings.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Settings extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
public $table = "settings";
|
||||
|
||||
protected $guarded = [
|
||||
'id'
|
||||
];
|
||||
}
|
||||
10
app/Models/SuperAdmin.php
Executable file
10
app/Models/SuperAdmin.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SuperAdmin extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
23
app/Models/Topup.php
Executable file
23
app/Models/Topup.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Topup extends Model
|
||||
{
|
||||
|
||||
public $table = "top_ups";
|
||||
|
||||
public function merchant()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Merchant', 'merchant_id', 'id');
|
||||
}
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('App\User', 'created_by', 'id');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
17
app/Models/Transaction.php
Executable file
17
app/Models/Transaction.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Transaction extends Model
|
||||
{
|
||||
//
|
||||
protected $guarded = [
|
||||
'id'
|
||||
];
|
||||
public function merchant()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Merchant', 'merchant_id', 'id');
|
||||
}
|
||||
}
|
||||
45
app/Models/User.php
Normal file
45
app/Models/User.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'status'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user