diff --git a/.env.github b/.env.github index 36a93c19..fd87356b 100644 --- a/.env.github +++ b/.env.github @@ -2,7 +2,7 @@ APP_NAME=Laravel APP_ENV=local APP_KEY=base64:zR66Rx/bzt2/cu0BK92ijOXxCpGxoPCVgFEdHxZQa+k= APP_DEBUG=true -APP_URL=http://localhost +APP_URL=http://larachain.test LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null @@ -63,8 +63,5 @@ MAPBOX_TOKEN="foobar" ADMIN_ONE=bobbelcher@gmail.com ADMIN_ONE_PASSWORD=makeagoodone -ADMIN_TWO=bobbelcher+101@gmail.com -ADMIN_TWO_PASSWORD=makeagoodone - ## Fake key OPENAI_API_KEY=sk-m8ox9NVgboSLRCr5VA5RT3BXbkFJzP1QGUedbQxGmmuAQWRT diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 566aaee6..3cdb747d 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -40,7 +40,7 @@ jobs: - name: Get composer cache directory id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 @@ -54,16 +54,12 @@ jobs: - name: Install Composer dependencies run: | composer config http-basic.packages.craftable.pro "${{ secrets.CRAFTABLE_PRO_EMAIL }}" "${{ secrets.CRAFTABLE_PRO_LICENCE_KEY }}" - composer install --no-interaction --prefer-dist + composer install --no-progress --prefer-dist --optimize-autoloader - - name: Prepare the application + - name: Setup application run: | - php -r "file_exists('.env') || copy('.env.example', '.env');" - php artisan key:generate - - - name: Clear Config - run: php artisan config:clear - + cp .env.github .env + php artisan storage:link - name: PHP Code Style (phpcs) run: | diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php new file mode 100644 index 00000000..892caf8f --- /dev/null +++ b/app/Http/Controllers/CollectionController.php @@ -0,0 +1,44 @@ + CollectionResource::collection(Collection::query() + ->where("team_id", auth()->user()->current_team_id) + ->get()) + ]); + } + + public function store() { + + $validated = request()->validate([ + 'name' => 'required', + 'description' => 'required', + ]); + + $validated['team_id'] = auth()->user()->current_team_id; + + $collection = Collection::create($validated); + /** + * Make and then reditect to the view page + */ + request()->session()->flash("flash.banner", "Collection created successfully!"); + + return to_route('collections.show', $collection); + } + + public function show(Collection $collection) { + return inertia("Collection/Show", [ + 'collection' => new CollectionResource($collection) + ]); + } +} diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index 4739b0d4..a677547e 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -37,6 +37,7 @@ public function version(Request $request): ?string public function share(Request $request): array { return array_merge(parent::share($request), [ + 'app_name' => config("app.name"), 'features' => Feature::all(), ]); } diff --git a/app/Http/Resources/CollectionResource.php b/app/Http/Resources/CollectionResource.php new file mode 100644 index 00000000..4b3d6b58 --- /dev/null +++ b/app/Http/Resources/CollectionResource.php @@ -0,0 +1,19 @@ + + */ + public function toArray(Request $request): array + { + return parent::toArray($request); + } +} diff --git a/app/Jobs/ProcessFileJob.php b/app/Jobs/ProcessFileJob.php index 5fc77f93..f989e71d 100644 --- a/app/Jobs/ProcessFileJob.php +++ b/app/Jobs/ProcessFileJob.php @@ -30,6 +30,11 @@ public function __construct(public Document $document) */ public function handle(): void { + /** + * @TODO + * Make a test. I am keeping this simple to just run the batch + * but if it does more needs a test + */ //This will trigger a batch job chain that will do the following for all the document pages // it will save this on a Collections Watchers so we can see it in the UI. //1) Chunk up the data diff --git a/app/Providers/JetstreamServiceProvider.php b/app/Providers/JetstreamServiceProvider.php index ca8ce8e6..e2288448 100644 --- a/app/Providers/JetstreamServiceProvider.php +++ b/app/Providers/JetstreamServiceProvider.php @@ -52,10 +52,10 @@ protected function configurePermissions(): void 'delete', ])->description('Administrator users can perform any action.'); - Jetstream::role('editor', 'Editor', [ + Jetstream::role('member', 'Member', [ 'read', 'create', 'update', - ])->description('Editor users have the ability to read, create, and update.'); + ])->description('Member users have the ability to read, create, and update.'); } } diff --git a/config/app.php b/config/app.php index f4672673..1991f978 100644 --- a/config/app.php +++ b/config/app.php @@ -13,7 +13,7 @@ | */ - 'name' => env('APP_NAME', 'Laravel'), + 'name' => env('APP_NAME', 'Ai Hub'), /* |-------------------------------------------------------------------------- diff --git a/config/jetstream.php b/config/jetstream.php index 32f1a315..8c199fdc 100644 --- a/config/jetstream.php +++ b/config/jetstream.php @@ -59,7 +59,7 @@ 'features' => [ // Features::termsAndPrivacyPolicy(), - // Features::profilePhotos(), + Features::profilePhotos(), // Features::api(), Features::teams(['invitations' => true]), Features::accountDeletion(), diff --git a/phpunit.xml b/phpunit.xml index d5a6d610..e90e0b93 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -22,15 +22,15 @@ - + - + diff --git a/resources/js/Components/PrimaryButtonLink.vue b/resources/js/Components/PrimaryButtonLink.vue new file mode 100644 index 00000000..09377e67 --- /dev/null +++ b/resources/js/Components/PrimaryButtonLink.vue @@ -0,0 +1,15 @@ + + + diff --git a/resources/js/Components/TextArea.vue b/resources/js/Components/TextArea.vue new file mode 100644 index 00000000..90c5041d --- /dev/null +++ b/resources/js/Components/TextArea.vue @@ -0,0 +1,23 @@ + + + diff --git a/resources/js/Components/Welcome.vue b/resources/js/Components/Welcome.vue index 1f2c0b02..f5a37c0a 100644 --- a/resources/js/Components/Welcome.vue +++ b/resources/js/Components/Welcome.vue @@ -1,5 +1,14 @@ diff --git a/resources/js/Pages/Collection/Components/ResourceForm.vue b/resources/js/Pages/Collection/Components/ResourceForm.vue new file mode 100644 index 00000000..288d453e --- /dev/null +++ b/resources/js/Pages/Collection/Components/ResourceForm.vue @@ -0,0 +1,29 @@ +