This commit is contained in:
Marley Rae 2022-04-29 11:52:58 -07:00
parent 83b01a84df
commit 555637aab4
21 changed files with 857 additions and 0 deletions

View file

@ -0,0 +1,86 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreCountryRequest;
use App\Http\Requests\UpdateCountryRequest;
use App\Models\Country;
class CountryController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \App\Http\Requests\StoreCountryRequest $request
* @return \Illuminate\Http\Response
*/
public function store(StoreCountryRequest $request)
{
//
}
/**
* Display the specified resource.
*
* @param \App\Models\Country $country
* @return \Illuminate\Http\Response
*/
public function show(Country $country)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Country $country
* @return \Illuminate\Http\Response
*/
public function edit(Country $country)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \App\Http\Requests\UpdateCountryRequest $request
* @param \App\Models\Country $country
* @return \Illuminate\Http\Response
*/
public function update(UpdateCountryRequest $request, Country $country)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Country $country
* @return \Illuminate\Http\Response
*/
public function destroy(Country $country)
{
//
}
}

View file

@ -0,0 +1,86 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreMemberRequest;
use App\Http\Requests\UpdateMemberRequest;
use App\Models\Member;
class MemberController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \App\Http\Requests\StoreMemberRequest $request
* @return \Illuminate\Http\Response
*/
public function store(StoreMemberRequest $request)
{
//
}
/**
* Display the specified resource.
*
* @param \App\Models\Member $member
* @return \Illuminate\Http\Response
*/
public function show(Member $member)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Member $member
* @return \Illuminate\Http\Response
*/
public function edit(Member $member)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \App\Http\Requests\UpdateMemberRequest $request
* @param \App\Models\Member $member
* @return \Illuminate\Http\Response
*/
public function update(UpdateMemberRequest $request, Member $member)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Member $member
* @return \Illuminate\Http\Response
*/
public function destroy(Member $member)
{
//
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreCountryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreMemberRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateCountryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateMemberRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

11
app/Models/Country.php Normal file
View file

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Country extends Model
{
use HasFactory;
}

15
app/Models/Member.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace App\Models;
use App\Traits\Ownable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Member extends Model
{
use HasFactory;
use Ownable;
/* ----------------------------------------------------------------------- relationships ---- */
}

View file

@ -0,0 +1,94 @@
<?php
namespace App\Policies;
use App\Models\Collective;
use App\Models\Country;
use Illuminate\Auth\Access\HandlesAuthorization;
class CountryPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*
* @param \App\Models\Collective $collective
* @return \Illuminate\Auth\Access\Response|bool
*/
public function viewAny(Collective $collective)
{
//
}
/**
* Determine whether the user can view the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Country $country
* @return \Illuminate\Auth\Access\Response|bool
*/
public function view(Collective $collective, Country $country)
{
//
}
/**
* Determine whether the user can create models.
*
* @param \App\Models\Collective $collective
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create(Collective $collective)
{
//
}
/**
* Determine whether the user can update the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Country $country
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update(Collective $collective, Country $country)
{
//
}
/**
* Determine whether the user can delete the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Country $country
* @return \Illuminate\Auth\Access\Response|bool
*/
public function delete(Collective $collective, Country $country)
{
//
}
/**
* Determine whether the user can restore the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Country $country
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restore(Collective $collective, Country $country)
{
//
}
/**
* Determine whether the user can permanently delete the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Country $country
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDelete(Collective $collective, Country $country)
{
//
}
}

View file

@ -0,0 +1,94 @@
<?php
namespace App\Policies;
use App\Models\Collective;
use App\Models\Member;
use Illuminate\Auth\Access\HandlesAuthorization;
class MemberPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*
* @param \App\Models\Collective $collective
* @return \Illuminate\Auth\Access\Response|bool
*/
public function viewAny(Collective $collective)
{
//
}
/**
* Determine whether the user can view the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Member $member
* @return \Illuminate\Auth\Access\Response|bool
*/
public function view(Collective $collective, Member $member)
{
//
}
/**
* Determine whether the user can create models.
*
* @param \App\Models\Collective $collective
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create(Collective $collective)
{
//
}
/**
* Determine whether the user can update the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Member $member
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update(Collective $collective, Member $member)
{
//
}
/**
* Determine whether the user can delete the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Member $member
* @return \Illuminate\Auth\Access\Response|bool
*/
public function delete(Collective $collective, Member $member)
{
//
}
/**
* Determine whether the user can restore the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Member $member
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restore(Collective $collective, Member $member)
{
//
}
/**
* Determine whether the user can permanently delete the model.
*
* @param \App\Models\Collective $collective
* @param \App\Models\Member $member
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDelete(Collective $collective, Member $member)
{
//
}
}

View file

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Country>
*/
class CountryFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
//
];
}
}

View file

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Member>
*/
class MemberFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
//
];
}
}

View file

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class() extends Migration {
/**
* Run the migrations.
*/
public function up()
{
Schema::create('countries', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('name');
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::dropIfExists('countries');
}
};

View file

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class() extends Migration {
/**
* Run the migrations.
*/
public function up()
{
Schema::create('members', function (Blueprint $table) {
$table->id();
$table->timestamps(6);
$table->string('name');
$table->string('email');
$table->boolean('show_email');
$table->foreignId('country_id')
->constrained('countries')
->onUpdate('cascade')
->onDelete('restrict');
$table->string('password');
$table->string('url')->nullable();
$table->longText('comments')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::dropIfExists('members');
}
};

View file

@ -0,0 +1,213 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class CountrySeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run()
{
DB::table('countries')->insert([
['name' => 'Afghanistan'],
['name' => 'Albania'],
['name' => 'Algeria'],
['name' => 'Andorra'],
['name' => 'Angola'],
['name' => 'Antigua and Barbuda'],
['name' => 'Argentina'],
['name' => 'Armenia'],
['name' => 'Australia'],
['name' => 'Austria'],
['name' => 'Azerbaijan'],
['name' => 'Bahamas, The'],
['name' => 'Bahrain'],
['name' => 'Bangladesh'],
['name' => 'Barbados'],
['name' => 'Belarus'],
['name' => 'Belgium'],
['name' => 'Belize'],
['name' => 'Benin'],
['name' => 'Bolivia'],
['name' => 'Bosnia and Herzegovina'],
['name' => 'Botswana'],
['name' => 'Brazil'],
['name' => 'Brunei'],
['name' => 'Bulgaria'],
['name' => 'Burkina Faso'],
['name' => 'Burundi'],
['name' => 'Cabo Verde'],
['name' => 'Cambodia'],
['name' => 'Cameroon'],
['name' => 'Canada'],
['name' => 'Central African Republic (CAR)'],
['name' => 'Chad'],
['name' => 'Chile'],
['name' => 'China'],
['name' => 'Colombia'],
['name' => 'Comoros'],
['name' => 'Congo, Democratic Republic of the'],
['name' => 'Congo, Republic of the'],
['name' => 'Costa Rica'],
['name' => "Cote d'Ivoire"],
['name' => 'Croatia'],
['name' => 'Cuba'],
['name' => 'Cyprus'],
['name' => 'Czechia'],
['name' => 'Denmark'],
['name' => 'Djibouti'],
['name' => 'Dominica'],
['name' => 'Dominican Republic'],
['name' => 'Ecuador'],
['name' => 'Egypt'],
['name' => 'El Salvador'],
['name' => 'Equatorial Guinea'],
['name' => 'Eritrea'],
['name' => 'Estonia'],
['name' => 'Eswatini'],
['name' => 'Ethiopia'],
['name' => 'Fiji'],
['name' => 'Finland'],
['name' => 'France'],
['name' => 'Gabon'],
['name' => 'Gambia'],
['name' => 'Georgia'],
['name' => 'Germany'],
['name' => 'Ghana'],
['name' => 'Greece'],
['name' => 'Grenada'],
['name' => 'Guatemala'],
['name' => 'Guinea'],
['name' => 'Guinea-Bissau'],
['name' => 'Guyana'],
['name' => 'Haiti'],
['name' => 'Honduras'],
['name' => 'Hungary'],
['name' => 'Iceland'],
['name' => 'India'],
['name' => 'Indonesia'],
['name' => 'Iran'],
['name' => 'Iraq'],
['name' => 'Ireland'],
['name' => 'Italy'],
['name' => 'Jamaica'],
['name' => 'Japan'],
['name' => 'Jordan'],
['name' => 'Kazakhstan'],
['name' => 'Kenya'],
['name' => 'Kiribati'],
['name' => 'Kosovo'],
['name' => 'Kuwait'],
['name' => 'Kyrgyzstan'],
['name' => 'Laos'],
['name' => 'Latvia'],
['name' => 'Lebanon'],
['name' => 'Lesotho'],
['name' => 'Liberia'],
['name' => 'Libya'],
['name' => 'Liechtenstein'],
['name' => 'Lithuania'],
['name' => 'Luxembourg'],
['name' => 'Madagascar'],
['name' => 'Malawi'],
['name' => 'Malaysia'],
['name' => 'Maldives'],
['name' => 'Mali'],
['name' => 'Malta'],
['name' => 'Marshall Islands'],
['name' => 'Mauritania'],
['name' => 'Mauritius'],
['name' => 'Mexico'],
['name' => 'Micronesia'],
['name' => 'Moldova'],
['name' => 'Monaco'],
['name' => 'Mongolia'],
['name' => 'Montenegro'],
['name' => 'Morocco'],
['name' => 'Mozambique'],
['name' => 'Myanmar'],
['name' => 'Nambia'],
['name' => 'Nauru'],
['name' => 'Nepal'],
['name' => 'Netherlands'],
['name' => 'New Zealand'],
['name' => 'Nicaragua'],
['name' => 'Niger'],
['name' => 'Nigeria'],
['name' => 'North Korea'],
['name' => 'North Macedonia'],
['name' => 'Norway'],
['name' => 'Oman'],
['name' => 'Pakistan'],
['name' => 'Palau'],
['name' => 'Palestine'],
['name' => 'Panama'],
['name' => 'Papua New Guinea'],
['name' => 'Paraguay'],
['name' => 'Peru'],
['name' => 'Philippines'],
['name' => 'Poland'],
['name' => 'Portugal'],
['name' => 'Qatar'],
['name' => 'Romania'],
['name' => 'Russia'],
['name' => 'Rwanda'],
['name' => 'Saint Kitts and Nevis'],
['name' => 'Saint Lucia'],
['name' => 'Saint Vincent and the Grenadines'],
['name' => 'Samoa'],
['name' => 'San Marino'],
['name' => 'Sao Tome and Principe'],
['name' => 'Saudi Arabia'],
['name' => 'Senegal'],
['name' => 'Serbia'],
['name' => 'Seychelles'],
['name' => 'Sierra Leone'],
['name' => 'Singapore'],
['name' => 'Slovakia'],
['name' => 'Slovenia'],
['name' => 'Solomon Islands'],
['name' => 'Somalia'],
['name' => 'South Africa'],
['name' => 'South Korea'],
['name' => 'South Sudan'],
['name' => 'Spain'],
['name' => 'Sri Lanka'],
['name' => 'Sudan'],
['name' => 'Suriname'],
['name' => 'Sweden'],
['name' => 'Switzerland'],
['name' => 'Syria'],
['name' => 'Taiwan'],
['name' => 'Tajikistan'],
['name' => 'Tanzania'],
['name' => 'Thailand'],
['name' => 'Timor-Leste'],
['name' => 'Togo'],
['name' => 'Tonga'],
['name' => 'Trinidad and Tobago'],
['name' => 'Tunisia'],
['name' => 'Turkey'],
['name' => 'Turkmenistan'],
['name' => 'Tuvalu'],
['name' => 'Uganda'],
['name' => 'Ukraine'],
['name' => 'United Arab Emirates (UAE)'],
['name' => 'United Kingdom (UK)'],
['name' => 'United States of America (USA)'],
['name' => 'Uruguay'],
['name' => 'Uzbekistan'],
['name' => 'Vanuatu'],
['name' => 'Vatican City (Holy See)'],
['name' => 'Venezuela'],
['name' => 'Vietnam'],
['name' => 'Yemen'],
['name' => 'Zambia'],
['name' => 'Zimbabwe'],
]);
}
}

View file

@ -25,6 +25,8 @@ public function run()
CategorySeeder::class, CategorySeeder::class,
JoinedSeeder::class, JoinedSeeder::class,
OwnedSeeder::class, OwnedSeeder::class,
CountrySeeder::class,
MemberSeeder::class,
]); ]);
} }
} }

View file

@ -0,0 +1,19 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class MemberSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}

View file

@ -0,0 +1,2 @@
<?php

View file

@ -0,0 +1,3 @@
<?php

View file

@ -0,0 +1,2 @@
<?php

View file

@ -0,0 +1 @@
<?php