Skip to content

Commit 107a3c1

Browse files
committed
🌱 Stable version initial release
0 parents  commit 107a3c1

File tree

27 files changed

+645
-0
lines changed

27 files changed

+645
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Contracts\V1\Services;
6+
7+
interface BaseServiceInterface
8+
{
9+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Database\Factory\V1\BaseFactory;
6+
7+
use Illuminate\Database\Eloquent\Factories\Factory;
8+
use Illuminate\Support\Collection;
9+
10+
abstract class BaseFactory extends Factory
11+
{
12+
/**
13+
* Construct the factory
14+
*/
15+
public function __construct($count = null, ?Collection $states = null, ?Collection $has = null, ?Collection $for = null, ?Collection $afterMaking = null, ?Collection $afterCreating = null, $connection = null, ?Collection $recycle = null)
16+
{
17+
parent::__construct($count, $states, $has, $for, $afterMaking, $afterCreating, $connection, $recycle);
18+
19+
$this->model = $this->model();
20+
}
21+
22+
/**
23+
* Get the target model
24+
*/
25+
abstract public function model(): string;
26+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Database\Seeders\V1\BaseDatabaseSeeder;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
use Illuminate\Database\Seeder;
9+
10+
class BaseDatabaseSeeder extends Seeder
11+
{
12+
/**
13+
* Run the database seeds.
14+
*/
15+
public function run(): void
16+
{
17+
Model::unguard();
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Database\Seeders\V1\BaseTableSeeder;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
use Illuminate\Database\Seeder;
9+
10+
class BaseTableSeeder extends Seeder
11+
{
12+
/**
13+
* Run the database seeds.
14+
*/
15+
public function run(): void
16+
{
17+
Model::unguard();
18+
}
19+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Entities\V1;
6+
7+
use Foundation\Support\Traits\V1\HasFieldsEnum\HasFieldsEnum;
8+
use Illuminate\Database\Eloquent\SoftDeletes;
9+
use Illuminate\Foundation\Auth\User as Authenticatable;
10+
use Illuminate\Notifications\Notifiable;
11+
12+
class BaseAuthenticatableModel extends Authenticatable
13+
{
14+
use HasFieldsEnum;
15+
use Notifiable;
16+
use SoftDeletes;
17+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/** @noinspection PhpUnused */
4+
5+
declare(strict_types=1);
6+
7+
namespace Foundation\Base\Entities\V1\BaseFields;
8+
9+
abstract class BaseFields
10+
{
11+
public const DELETED_AT = 'deleted_at';
12+
13+
public const CREATED_AT = 'created_at';
14+
15+
public const UPDATED_AT = 'updated_at';
16+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Entities\V1;
6+
7+
use Foundation\Support\Traits\V1\HasFieldsEnum\HasFieldsEnum;
8+
use Illuminate\Database\Eloquent\Model;
9+
10+
class BaseHardDeletableModel extends Model
11+
{
12+
use HasFieldsEnum;
13+
}

‎Entities/V1/BaseModel.php‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Entities\V1;
6+
7+
use Foundation\Support\Traits\V1\HasFieldsEnum\HasFieldsEnum;
8+
use Illuminate\Database\Eloquent\SoftDeletes;
9+
10+
class BaseModel extends BaseHardDeletableModel
11+
{
12+
use HasFieldsEnum;
13+
use SoftDeletes;
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Http\Controllers\V1\BaseApiController;
6+
7+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
8+
use Illuminate\Foundation\Validation\ValidatesRequests;
9+
use Illuminate\Routing\Controller;
10+
11+
class BaseApiController extends Controller
12+
{
13+
use AuthorizesRequests;
14+
use ValidatesRequests;
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Foundation\Base\Http\Controllers\V1\BaseController;
6+
7+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
8+
use Illuminate\Foundation\Validation\ValidatesRequests;
9+
use Illuminate\Routing\Controller;
10+
11+
class BaseController extends Controller
12+
{
13+
use AuthorizesRequests;
14+
use ValidatesRequests;
15+
}

0 commit comments

Comments
 (0)