From d80bc293b99bb7a6c674154656af5e977775d6bb Mon Sep 17 00:00:00 2001 From: Allan Kong Date: Sat, 19 Jul 2025 11:16:25 -0700 Subject: [PATCH 1/4] Forgot to allow children as a difficulty --- composer.json | 1 + composer.lock | 150 +++++++++++++++++- config/computerScienceResource.php | 2 +- ...reate_computer_science_resources_table.php | 2 +- resources/js/Pages/Resources/Create.vue | 1 + 5 files changed, 153 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 17b82b48..6193d31f 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "license": "MIT", "require": { "php": "^8.2", + "cviebrock/eloquent-sluggable": "^11.0", "inertiajs/inertia-laravel": "^2.0", "joelbutcher/socialstream": "^6.2", "laravel/framework": "^11.31", diff --git a/composer.lock b/composer.lock index 3380bfbf..64b322fc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "42cee1297eabe050f6a451aef2908c3b", + "content-hash": "221a502645753e2ec18df636c08462d0", "packages": [ { "name": "bacon/bacon-qr-code", @@ -189,6 +189,154 @@ ], "time": "2024-02-09T16:56:22+00:00" }, + { + "name": "cocur/slugify", + "version": "v4.6.0", + "source": { + "type": "git", + "url": "https://github.com/cocur/slugify.git", + "reference": "1d674022e9cbefa80b4f51aa3e2375b6e3c14fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cocur/slugify/zipball/1d674022e9cbefa80b4f51aa3e2375b6e3c14fdb", + "reference": "1d674022e9cbefa80b4f51aa3e2375b6e3c14fdb", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "conflict": { + "symfony/config": "<3.4 || >=4,<4.3", + "symfony/dependency-injection": "<3.4 || >=4,<4.3", + "symfony/http-kernel": "<3.4 || >=4,<4.3", + "twig/twig": "<2.12.1" + }, + "require-dev": { + "laravel/framework": "^5.0|^6.0|^7.0|^8.0", + "latte/latte": "~2.2", + "league/container": "^2.2.0", + "mikey179/vfsstream": "~1.6.8", + "mockery/mockery": "^1.3", + "nette/di": "~2.4", + "pimple/pimple": "~1.1", + "plumphp/plum": "~0.1", + "symfony/config": "^3.4 || ^4.3 || ^5.0 || ^6.0", + "symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0 || ^6.0", + "symfony/http-kernel": "^3.4 || ^4.3 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0", + "twig/twig": "^2.12.1 || ~3.0", + "zendframework/zend-modulemanager": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zendframework/zend-view": "~2.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cocur\\Slugify\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florian Eckerstorfer", + "email": "florian@eckerstorfer.co", + "homepage": "https://florian.ec" + }, + { + "name": "Ivo Bathke", + "email": "ivo.bathke@gmail.com" + } + ], + "description": "Converts a string into a slug.", + "keywords": [ + "slug", + "slugify" + ], + "support": { + "issues": "https://github.com/cocur/slugify/issues", + "source": "https://github.com/cocur/slugify/tree/v4.6.0" + }, + "time": "2024-09-10T14:09:25+00:00" + }, + { + "name": "cviebrock/eloquent-sluggable", + "version": "11.0.1", + "source": { + "type": "git", + "url": "https://github.com/cviebrock/eloquent-sluggable.git", + "reference": "a4281cf0284a21efc1031a065b112ddd6c826eea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/a4281cf0284a21efc1031a065b112ddd6c826eea", + "reference": "a4281cf0284a21efc1031a065b112ddd6c826eea", + "shasum": "" + }, + "require": { + "cocur/slugify": "^4.3", + "illuminate/config": "^11.0", + "illuminate/database": "^11.0", + "illuminate/support": "^11.0", + "php": "^8.2" + }, + "require-dev": { + "mockery/mockery": "^1.4.4", + "orchestra/testbench": "^9.0", + "pestphp/pest": "^2.28" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Cviebrock\\EloquentSluggable\\ServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "11.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Cviebrock\\EloquentSluggable\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Colin Viebrock", + "email": "colin@viebrock.ca" + } + ], + "description": "Easy creation of slugs for your Eloquent models in Laravel", + "homepage": "https://github.com/cviebrock/eloquent-sluggable", + "keywords": [ + "eloquent", + "eloquent-sluggable", + "laravel", + "lumen", + "slug", + "sluggable" + ], + "support": { + "issues": "https://github.com/cviebrock/eloquent-sluggable/issues", + "source": "https://github.com/cviebrock/eloquent-sluggable/tree/11.0.1" + }, + "funding": [ + { + "url": "https://github.com/cviebrock", + "type": "github" + } + ], + "time": "2024-11-29T01:32:17+00:00" + }, { "name": "dasprid/enum", "version": "1.0.6", diff --git a/config/computerScienceResource.php b/config/computerScienceResource.php index 80ca81d6..bc587fec 100644 --- a/config/computerScienceResource.php +++ b/config/computerScienceResource.php @@ -2,6 +2,6 @@ return [ 'platforms' => ['book', 'podcast', 'youtube_channel', 'blog', 'website', 'organization', 'service', 'bootcamp', 'newsletter', 'workshop', 'course', 'forum', 'mobile_app', 'desktop_app', 'magazine'], - 'difficulties' => ['beginner', 'industry_simple', 'industry_standard', 'industry_professional', 'academic'], + 'difficulties' => ['children', 'beginner', 'industry_simple', 'industry_standard', 'industry_professional', 'academic'], 'pricings' => ['free', 'paid', 'freemium'], ]; diff --git a/database/migrations/2025_01_24_171530_create_computer_science_resources_table.php b/database/migrations/2025_01_24_171530_create_computer_science_resources_table.php index 9e5ccf9a..0836ff5c 100644 --- a/database/migrations/2025_01_24_171530_create_computer_science_resources_table.php +++ b/database/migrations/2025_01_24_171530_create_computer_science_resources_table.php @@ -28,7 +28,7 @@ public function up(): void $table->set('platforms', ['book', 'podcast', 'youtube_channel', 'blog', 'website', 'organization', 'service', 'bootcamp', 'newsletter', 'workshop', 'course', 'forum', 'mobile_app', 'desktop_app', 'magazine']) ->index(); - $table->enum('difficulty', ['beginner', 'industry_simple', 'industry_standard', 'industry_professional', 'academic']) + $table->enum('difficulty', ['children', 'beginner', 'industry_simple', 'industry_standard', 'industry_professional', 'academic']) ->index(); $table->enum('pricing', ['free', 'premium', 'paid', 'freemium']) ->index(); diff --git a/resources/js/Pages/Resources/Create.vue b/resources/js/Pages/Resources/Create.vue index 4307f1b4..df022999 100644 --- a/resources/js/Pages/Resources/Create.vue +++ b/resources/js/Pages/Resources/Create.vue @@ -78,6 +78,7 @@ const handleFormChange = (newFormData) => {