diff --git a/.gitignore b/.gitignore index eb003b0..37cd3bd 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,36 @@ npm-debug.log yarn-error.log /.idea /.vscode + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud \ No newline at end of file diff --git a/app/Models/Filter.php b/app/Models/Filter.php new file mode 100644 index 0000000..aaa1f19 --- /dev/null +++ b/app/Models/Filter.php @@ -0,0 +1,15 @@ +belongsTo(FilterType::class); + } +} diff --git a/app/Models/FilterResourceType.php b/app/Models/FilterResourceType.php new file mode 100644 index 0000000..17f3200 --- /dev/null +++ b/app/Models/FilterResourceType.php @@ -0,0 +1,19 @@ +hasMany(Filter::class); + } + + public function resourceType(){ + return $this->hasMany(ResourceType::class); + } +} diff --git a/app/Models/FilterValue.php b/app/Models/FilterValue.php new file mode 100644 index 0000000..551ed71 --- /dev/null +++ b/app/Models/FilterValue.php @@ -0,0 +1,15 @@ +hasMany(Filter::class); + } +} diff --git a/app/Models/Resource.php b/app/Models/Resource.php new file mode 100644 index 0000000..d7044a8 --- /dev/null +++ b/app/Models/Resource.php @@ -0,0 +1,19 @@ +belongsTo(Institution::class); + } + + public function resourceType(){ + return $this->belongsTo(ResourceType::class); + } +} diff --git a/app/Models/ResourceResourceFooter.php b/app/Models/ResourceResourceFooter.php new file mode 100644 index 0000000..d8e9f07 --- /dev/null +++ b/app/Models/ResourceResourceFooter.php @@ -0,0 +1,19 @@ +hasMany(Resource::class); + } + + public function resourceFooter(){ + return $this->hasOne(Resource::class); + } +} diff --git a/database/factories/FilterFactory.php b/database/factories/FilterFactory.php new file mode 100644 index 0000000..3c99b96 --- /dev/null +++ b/database/factories/FilterFactory.php @@ -0,0 +1,24 @@ + + */ +class FilterFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'label'=>fake->text($maxNbChars = 50), + 'filter_type_id'=>FilterType::factory() + ]; + } +} diff --git a/database/factories/FilterResourceTypesFactory.php b/database/factories/FilterResourceTypesFactory.php new file mode 100644 index 0000000..e1e6de3 --- /dev/null +++ b/database/factories/FilterResourceTypesFactory.php @@ -0,0 +1,24 @@ + + */ +class FilterResourceTypesFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'filter_id'=>Filter::factory(), + 'resource_type_id'=>ResourceType::factory() + ]; + } +} diff --git a/database/factories/FilterTypesFactory.php b/database/factories/FilterTypesFactory.php new file mode 100644 index 0000000..1a34dd3 --- /dev/null +++ b/database/factories/FilterTypesFactory.php @@ -0,0 +1,23 @@ + + */ +class FilterTypesFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'input_type'=>fake()->text($maxNbchars = 100) + ]; + } +} diff --git a/database/factories/FilterValuesFactory.php b/database/factories/FilterValuesFactory.php new file mode 100644 index 0000000..a4b70fa --- /dev/null +++ b/database/factories/FilterValuesFactory.php @@ -0,0 +1,24 @@ + + */ +class FilterValuesFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'value'=>text($maxNbChars = 50), + 'filter_id'=>Filter::factory() + ]; + } +} diff --git a/database/factories/FundingsFactory.php b/database/factories/FundingsFactory.php new file mode 100644 index 0000000..7557529 --- /dev/null +++ b/database/factories/FundingsFactory.php @@ -0,0 +1,26 @@ + + */ +class FundingsFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'type'=>fake(), + 'eligibility'=>fake(), + 'application_deadline'=>"December 31, 2023", + 'highlight'=>fake()->text($maxNbChars = 1000) + ]; + } +} diff --git a/database/factories/InstitutionFactory.php b/database/factories/InstitutionFactory.php new file mode 100644 index 0000000..0efcc98 --- /dev/null +++ b/database/factories/InstitutionFactory.php @@ -0,0 +1,25 @@ + + */ +class InstitutionFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'name'=>fake()->company(), + 'icon'=>fake()->imageUrl($width = 640, $height = 480), + 'location'=>fake()->state() + ]; + } +} diff --git a/database/factories/OpportunitiesFactory.php b/database/factories/OpportunitiesFactory.php new file mode 100644 index 0000000..8bdaa82 --- /dev/null +++ b/database/factories/OpportunitiesFactory.php @@ -0,0 +1,26 @@ + + */ +class OpportunitiesFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'program_length'=>random_int(1,20), + 'admissions_requirements'=>fake()->text($maxNbChars = 200), + 'highlight'=>fake()->text($maxNbChars = 1000), + 'financial'=>fake()->text($maxNbChars = 100) + ]; + } +} diff --git a/database/factories/ProgramsFactory.php b/database/factories/ProgramsFactory.php new file mode 100644 index 0000000..f7ad530 --- /dev/null +++ b/database/factories/ProgramsFactory.php @@ -0,0 +1,26 @@ + + */ +class ProgramsFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'program_length'=>random_int(1,20), + 'location'=>address(), + 'highlight'=>fake()->text($maxNbChars = 1000), + 'cost'=>randomFloat($nbMaxDecimals = NULL, $min = 0, $max = NULL) + ]; + } +} diff --git a/database/factories/ResourceFooterFactory.php b/database/factories/ResourceFooterFactory.php new file mode 100644 index 0000000..096e0c5 --- /dev/null +++ b/database/factories/ResourceFooterFactory.php @@ -0,0 +1,24 @@ + + */ +class ResourceFooterFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'additional_info'=>fake()->text($maxNbChars = 200), + 'link'=>fake()->url() + ]; + } +} diff --git a/database/factories/ResourceResourceFootersFactory.php b/database/factories/ResourceResourceFootersFactory.php new file mode 100644 index 0000000..15d9923 --- /dev/null +++ b/database/factories/ResourceResourceFootersFactory.php @@ -0,0 +1,24 @@ + + */ +class ResourceResourceFootersFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'resource_id'=>Resource::factory(), + 'resource_footer_id'=>ResourceFooter::factory() + ]; + } +} diff --git a/database/factories/ResourceTypeFactory.php b/database/factories/ResourceTypeFactory.php new file mode 100644 index 0000000..7118ba4 --- /dev/null +++ b/database/factories/ResourceTypeFactory.php @@ -0,0 +1,23 @@ + + */ +class ResourceTypeFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'name'=>fake()->jobTitle() + ]; + } +} diff --git a/database/factories/ResourcesFactory.php b/database/factories/ResourcesFactory.php new file mode 100644 index 0000000..a42ba63 --- /dev/null +++ b/database/factories/ResourcesFactory.php @@ -0,0 +1,28 @@ + + */ +class ResourcesFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'title'=>fake(), + 'content'=>text($maxNbChars = 1500), + 'status'=>random_int(0,1), + 'views_last_month'=>random_in(0,5000), + 'institution_id'=>Institution::factory(), + + ]; + } +} diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index a24ce53..4970dfd 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -2,46 +2,39 @@ namespace Database\Factories; -use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; +/** + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User> + */ class UserFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var string - */ - protected $model = User::class; - /** * Define the model's default state. * - * @return array + * @return array */ public function definition() { return [ - 'name' => $this->faker->name(), - 'email' => $this->faker->unique()->safeEmail(), - 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password - 'remember_token' => Str::random(10), + 'name'=>fake()->name(), + 'email'=>fake()->safeEmail(), + 'email_verified_at'=>now(), + 'password'=>'$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'remember_token'=>Str::random(10), ]; } /** * Indicate that the model's email address should be unverified. * - * @return \Illuminate\Database\Eloquent\Factories\Factory + * @return static */ public function unverified() { - return $this->state(function (array $attributes) { - return [ - 'email_verified_at' => null, - ]; - }); + return $this->state(fn (array $attributes) => [ + 'email_verified_at' => null, + ]); } } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 621a24e..cf6b776 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateUsersTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -33,4 +33,4 @@ public function down() { Schema::dropIfExists('users'); } -} +}; diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index 0ee0a36..fcacb80 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreatePasswordResetsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -29,4 +29,4 @@ public function down() { Schema::dropIfExists('password_resets'); } -} +}; diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index 6aa6d74..1719198 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateFailedJobsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -33,4 +33,4 @@ public function down() { Schema::dropIfExists('failed_jobs'); } -} +}; diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php index 3ce0002..6c81fd2 100644 --- a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreatePersonalAccessTokensTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -14,12 +14,13 @@ class CreatePersonalAccessTokensTable extends Migration public function up() { Schema::create('personal_access_tokens', function (Blueprint $table) { - $table->bigIncrements('id'); + $table->id(); $table->morphs('tokenable'); $table->string('name'); $table->string('token', 64)->unique(); $table->text('abilities')->nullable(); $table->timestamp('last_used_at')->nullable(); + $table->timestamp('expires_at')->nullable(); $table->timestamps(); }); } @@ -33,4 +34,4 @@ public function down() { Schema::dropIfExists('personal_access_tokens'); } -} +}; diff --git a/database/migrations/2023_01_29_192104_create_institutions_table.php b/database/migrations/2023_01_29_192104_create_institutions_table.php new file mode 100644 index 0000000..75f088b --- /dev/null +++ b/database/migrations/2023_01_29_192104_create_institutions_table.php @@ -0,0 +1,33 @@ +id()->autoIncrement()->primary(); + $table->string("name"); + $table->string("icon"); + $table->string("location"); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('institutions'); + } +}; diff --git a/database/migrations/2023_01_29_192203_create_resource_types_table.php b/database/migrations/2023_01_29_192203_create_resource_types_table.php new file mode 100644 index 0000000..2bd3869 --- /dev/null +++ b/database/migrations/2023_01_29_192203_create_resource_types_table.php @@ -0,0 +1,31 @@ +id()->autoIncrement()->primary(); + $table->string("name")->unique(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('resource_types'); + } +}; diff --git a/database/migrations/2023_01_29_192219_create_resources_table.php b/database/migrations/2023_01_29_192219_create_resources_table.php new file mode 100644 index 0000000..872e93d --- /dev/null +++ b/database/migrations/2023_01_29_192219_create_resources_table.php @@ -0,0 +1,39 @@ +id()->autoIncrement()->primary(); + $table->string("title")->nullable(); + $table->text("content"); + $table->boolean("status")->default(false); + $table->integer("views_last_month")->default(0); + $table->integer("institution_id"); + $table->integer("resourceable_id"); + $table->integer("resource_type_id"); + $table->foreign("institution_id")->constrained(); + $table->foreign("resource_type_id")->constrained(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('resources'); + } +}; diff --git a/database/migrations/2023_01_29_192240_create_resource_footers_table.php b/database/migrations/2023_01_29_192240_create_resource_footers_table.php new file mode 100644 index 0000000..80498c0 --- /dev/null +++ b/database/migrations/2023_01_29_192240_create_resource_footers_table.php @@ -0,0 +1,32 @@ +id()->autoIncrement()->primary(); + $table->string("additional_info"); + $table->string("link"); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('resource_footers'); + } +}; diff --git a/database/migrations/2023_01_29_192241_create_programs_table.php b/database/migrations/2023_01_29_192241_create_programs_table.php new file mode 100644 index 0000000..2cba06a --- /dev/null +++ b/database/migrations/2023_01_29_192241_create_programs_table.php @@ -0,0 +1,34 @@ +id(); + $table->string("program_length"); + $table->string("location"); + $table->text("highlight"); + $table->unsignedDouble("cost"); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('programs'); + } +}; diff --git a/database/migrations/2023_01_29_192315_create_fundings_table.php b/database/migrations/2023_01_29_192315_create_fundings_table.php new file mode 100644 index 0000000..8a6f249 --- /dev/null +++ b/database/migrations/2023_01_29_192315_create_fundings_table.php @@ -0,0 +1,34 @@ +id()->autoIncrement()->primary(); + $table->string("type"); + $table->string("eligibility"); + $table->string("application_deadline"); + $table->text("highlight"); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('fundings'); + } +}; diff --git a/database/migrations/2023_01_29_192331_create_opportunities_table.php b/database/migrations/2023_01_29_192331_create_opportunities_table.php new file mode 100644 index 0000000..e9fa50a --- /dev/null +++ b/database/migrations/2023_01_29_192331_create_opportunities_table.php @@ -0,0 +1,34 @@ +id()->autoIncrement()->primary(); + $table->string("program_length"); + $table->text("admissions_requirements"); + $table->text("highlight"); + $table->string("financial"); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('opportunities'); + } +}; diff --git a/database/migrations/2023_01_29_192416_create_resource_resource_footers_table.php b/database/migrations/2023_01_29_192416_create_resource_resource_footers_table.php new file mode 100644 index 0000000..acb1fa0 --- /dev/null +++ b/database/migrations/2023_01_29_192416_create_resource_resource_footers_table.php @@ -0,0 +1,33 @@ +integer("resource_id"); + $table->integer("resource_footer_id"); + $table->foreign("resource_id")->constrained(); + $table->foreign("resource_footer_id")->constrained(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('resource_resource_footers'); + } +}; diff --git a/database/migrations/2023_01_29_192434_create_filter_types_table.php b/database/migrations/2023_01_29_192434_create_filter_types_table.php new file mode 100644 index 0000000..7200dc9 --- /dev/null +++ b/database/migrations/2023_01_29_192434_create_filter_types_table.php @@ -0,0 +1,31 @@ +id()->autoIncrement()->primary(); + $table->string("input_type")->unique(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('filter_types'); + } +}; diff --git a/database/migrations/2023_01_29_192447_create_filters_table.php b/database/migrations/2023_01_29_192447_create_filters_table.php new file mode 100644 index 0000000..f6cea25 --- /dev/null +++ b/database/migrations/2023_01_29_192447_create_filters_table.php @@ -0,0 +1,33 @@ +id()->autoIncrement()->primary(); + $table->string("label"); + $table->integer("filter_type_id"); + $table->foreign("filter_type_id")->constrained(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('filters'); + } +}; diff --git a/database/migrations/2023_01_29_192502_create_filter_values_table.php b/database/migrations/2023_01_29_192502_create_filter_values_table.php new file mode 100644 index 0000000..58e6a3c --- /dev/null +++ b/database/migrations/2023_01_29_192502_create_filter_values_table.php @@ -0,0 +1,33 @@ +id()->autoIncrement()->primary(); + $table->string("value"); + $table->integer("filter_id"); + $table->foreign("filter_id")->constrained(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('filter_values'); + } +}; diff --git a/database/migrations/2023_01_29_192525_create_filter_resource_types_table.php b/database/migrations/2023_01_29_192525_create_filter_resource_types_table.php new file mode 100644 index 0000000..e11ac81 --- /dev/null +++ b/database/migrations/2023_01_29_192525_create_filter_resource_types_table.php @@ -0,0 +1,33 @@ +integer("filter_id"); + $table->integer("resource_type_id"); + $table->foreign("filter_id")->constrained(); + $table->foreign("resource_type_id")->contrained(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('filter_resource_types'); + } +}; diff --git a/database/seeders/Filter.php b/database/seeders/Filter.php new file mode 100644 index 0000000..5bc81e1 --- /dev/null +++ b/database/seeders/Filter.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/FilterResourceTypes.php b/database/seeders/FilterResourceTypes.php new file mode 100644 index 0000000..26d48c8 --- /dev/null +++ b/database/seeders/FilterResourceTypes.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/FilterTypes.php b/database/seeders/FilterTypes.php new file mode 100644 index 0000000..c151983 --- /dev/null +++ b/database/seeders/FilterTypes.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/FilterValues.php b/database/seeders/FilterValues.php new file mode 100644 index 0000000..1ad99dd --- /dev/null +++ b/database/seeders/FilterValues.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/Fundings.php b/database/seeders/Fundings.php new file mode 100644 index 0000000..ca16e28 --- /dev/null +++ b/database/seeders/Fundings.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/Institution.php b/database/seeders/Institution.php new file mode 100644 index 0000000..a18b77a --- /dev/null +++ b/database/seeders/Institution.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/Programs.php b/database/seeders/Programs.php new file mode 100644 index 0000000..2831e3c --- /dev/null +++ b/database/seeders/Programs.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/ResourceFooter.php b/database/seeders/ResourceFooter.php new file mode 100644 index 0000000..6caead1 --- /dev/null +++ b/database/seeders/ResourceFooter.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/ResourceResourceFooters.php b/database/seeders/ResourceResourceFooters.php new file mode 100644 index 0000000..b43b507 --- /dev/null +++ b/database/seeders/ResourceResourceFooters.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/ResourceType.php b/database/seeders/ResourceType.php new file mode 100644 index 0000000..4c5581f --- /dev/null +++ b/database/seeders/ResourceType.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/Resources.php b/database/seeders/Resources.php new file mode 100644 index 0000000..df2e675 --- /dev/null +++ b/database/seeders/Resources.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..794d53a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,97 @@ +# For more information: https://laravel.com/docs/sail +version: '3' +services: + laravel.test: + build: + context: ./vendor/laravel/sail/runtimes/8.1 + dockerfile: Dockerfile + args: + WWWGROUP: '${WWWGROUP}' + image: sail-8.1/app + extra_hosts: + - 'host.docker.internal:host-gateway' + ports: + - '${APP_PORT:-80}:80' + - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' + environment: + WWWUSER: '${WWWUSER}' + LARAVEL_SAIL: 1 + XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' + XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' + volumes: + - '.:/var/www/html' + networks: + - sail + depends_on: + - mysql + - redis + - meilisearch + - mailhog + - selenium + mysql: + image: 'mysql/mysql-server:8.0' + ports: + - '${FORWARD_DB_PORT:-3306}:3306' + environment: + MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' + MYSQL_ROOT_HOST: "%" + MYSQL_DATABASE: '${DB_DATABASE}' + MYSQL_USER: '${DB_USERNAME}' + MYSQL_PASSWORD: '${DB_PASSWORD}' + MYSQL_ALLOW_EMPTY_PASSWORD: 1 + volumes: + - 'sail-mysql:/var/lib/mysql' + - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' + networks: + - sail + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"] + retries: 3 + timeout: 5s + redis: + image: 'redis:alpine' + ports: + - '${FORWARD_REDIS_PORT:-6379}:6379' + volumes: + - 'sail-redis:/data' + networks: + - sail + healthcheck: + test: ["CMD", "redis-cli", "ping"] + retries: 3 + timeout: 5s + meilisearch: + image: 'getmeili/meilisearch:latest' + ports: + - '${FORWARD_MEILISEARCH_PORT:-7700}:7700' + volumes: + - 'sail-meilisearch:/meili_data' + networks: + - sail + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--spider", "http://localhost:7700/health"] + retries: 3 + timeout: 5s + mailhog: + image: 'mailhog/mailhog:latest' + ports: + - '${FORWARD_MAILHOG_PORT:-1025}:1025' + - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025' + networks: + - sail + selenium: + image: 'selenium/standalone-chrome' + volumes: + - '/dev/shm:/dev/shm' + networks: + - sail +networks: + sail: + driver: bridge +volumes: + sail-mysql: + driver: local + sail-redis: + driver: local + sail-meilisearch: + driver: local