]> _ Git - psq.git/commitdiff
wip #7386 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Mar 2025 16:58:03 +0000 (17:58 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Mar 2025 16:58:03 +0000 (17:58 +0100)
.docker/production/docker-compose.yml
.idea/lettre-pharma.iml
.idea/php.xml
app/PdfFile.php
composer.json
composer.lock
config/app.php
config/scout.php

index 88ea33ac631573c45dd2542621971afe0473686c..764421b8e317c76e217190ec783e5a0a1fccdafa 100644 (file)
@@ -156,7 +156,7 @@ services:
 
   typesense:
     container_name: presquot-typesense
-    image: typesense/typesense:28.0
+    image: typesense/typesense:26.0
     restart: unless-stopped
     volumes:
       - ./typesense:/data
index 1b78ddc0ead7a2d7d164076c4f9a6427949caa98..0725d12b835529606f55a458fae7132d0dea583d 100644 (file)
       <excludeFolder url="file://$MODULE_DIR$/vendor/laravel-lang/lang" />
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/psr-http-message-bridge" />
       <excludeFolder url="file://$MODULE_DIR$/vendor/fluidbook/toolboxapiclient" />
+      <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/guzzle7-adapter" />
+      <excludeFolder url="file://$MODULE_DIR$/vendor/typesense/laravel-scout-typesense-driver" />
+      <excludeFolder url="file://$MODULE_DIR$/vendor/typesense/typesense-php" />
     </content>
     <content url="file://$MODULE_DIR$/node_modules" />
     <orderEntry type="inheritedJdk" />
index 301ef1583dd7d800b8e226757bdd977e81856b62..9d97bcffc5073eee86101b0fcca95530d422956e 100644 (file)
       <path value="$PROJECT_DIR$/vendor/spatie/pdf-to-text" />
       <path value="$PROJECT_DIR$/vendor/spatie/pdf-to-image" />
       <path value="$PROJECT_DIR$/vendor/kub-at/php-simple-html-dom-parser" />
-      <path value="$PROJECT_DIR$/vendor/algolia/algoliasearch-client-php" />
       <path value="$PROJECT_DIR$/vendor/seld/jsonlint" />
       <path value="$PROJECT_DIR$/vendor/seld/phar-utils" />
       <path value="$PROJECT_DIR$/vendor/justinrainbow/json-schema" />
       <path value="$PROJECT_DIR$/vendor/laravel-lang/lang" />
       <path value="$PROJECT_DIR$/vendor/symfony/psr-http-message-bridge" />
       <path value="$PROJECT_DIR$/vendor/fluidbook/toolboxapiclient" />
+      <path value="$PROJECT_DIR$/vendor/algolia/algoliasearch-client-php" />
       <path value="$PROJECT_DIR$/vendor/typesense/typesense-php" />
+      <path value="$PROJECT_DIR$/vendor/typesense/laravel-scout-typesense-driver" />
+      <path value="$PROJECT_DIR$/vendor/php-http/guzzle7-adapter" />
     </include_path>
   </component>
   <component name="PhpInterpreters">
index be90f610d740a05fa5f8752e55c2bdc33927bd87..d865db0d89dec9c1bbf773c532f42c6e437aa4ed 100644 (file)
@@ -67,6 +67,7 @@ class PdfFile extends TwillModel implements Sortable
     ];
 
     protected $fillable = [
+        'fluidbook',
         'free',
         'position',
         'title',
@@ -80,7 +81,8 @@ class PdfFile extends TwillModel implements Sortable
     ];
 
     protected $casts = [
-        'is_free' => 'bool',
+        'is_fluidbook' => 'bool',
+        'fluidbook' => 'bool',
         'headlines' => 'array',
     ];
 
@@ -107,6 +109,7 @@ class PdfFile extends TwillModel implements Sortable
             'slug' => Str::slug("{$collection->slug}_{$ref}"),
             'published' => 0,
             'collection_id' => $collection_id,
+            'fluidbook' => true,
         ],
             [
                 'ref' => $ref,
@@ -135,7 +138,7 @@ class PdfFile extends TwillModel implements Sortable
     public function process(): void
     {
         $client = new Client(env("FLUIDBOOK_TOOLBOX_API_TOKEN"));
-        $client->createFluidbook(new \SplFileInfo($this->pdfPath), env('FLUIDBOOK_TOOLBOX_BASE_FLUIDBOOK'), $this->title, env('FLUIDBOOK_TOOLBOX_EXTERNAL_SERVER'), 'PSQ-' . $this->ref);
+        $client->createFluidbook(new \SplFileInfo($this->absolutePdfPath), env('FLUIDBOOK_TOOLBOX_BASE_FLUIDBOOK'), $this->title, env('FLUIDBOOK_TOOLBOX_EXTERNAL_SERVER'), 'PSQ-' . $this->ref);
 
 //        \Log::debug('json');
 //        $this->makeJson();
@@ -243,7 +246,9 @@ class PdfFile extends TwillModel implements Sortable
      */
     public function getDirectoryAttribute(): string
     {
-        return "flowpaper/$this->slug";
+        $dir = $this->fluidbook ? 'fluidbook' : 'flowpaper';
+        return "$dir/$this->slug";
+
     }
 
 
index f430f01e53cf148b98185f6420efb1efd53a65f9..f158485305eacff293bf73c892fed73934ed742c 100644 (file)
@@ -42,6 +42,7 @@
         "masterminds/html5": "^2.9",
         "numaxlab/nova-ckeditor5-classic": "^1.1",
         "nyholm/psr7": "^1.8",
+        "php-http/guzzle7-adapter": "^1.1",
         "php-http/message-factory": "^1.1",
         "psq/psq-theme": "*",
         "pusher/pusher-php-server": "~4.1",
@@ -50,7 +51,7 @@
         "spatie/pdf-to-image": "^2.3",
         "spatie/pdf-to-text": "^1.53",
         "stripe/stripe-php": "^7.128",
-        "typesense/typesense-php": "^5.0",
+        "typesense/laravel-scout-typesense-driver": "^5.2",
         "vaites/php-apache-tika": "^v1.3"
     },
     "require-dev": {
index ea79b6f493b335512665120d4505ba36f2a157a1..85f047a3373111ce731e3d3e212b7e7d671efb36 100644 (file)
@@ -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": "ab7ec931421b0512e82bf2ec89f13d39",
+    "content-hash": "74f5ff2baf2220129295faabc3c4dbc7",
     "packages": [
         {
             "name": "algolia/algoliasearch-client-php",
             },
             "time": "2024-10-02T11:20:13+00:00"
         },
+        {
+            "name": "php-http/guzzle7-adapter",
+            "version": "1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-http/guzzle7-adapter.git",
+                "reference": "03a415fde709c2f25539790fecf4d9a31bc3d0eb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-http/guzzle7-adapter/zipball/03a415fde709c2f25539790fecf4d9a31bc3d0eb",
+                "reference": "03a415fde709c2f25539790fecf4d9a31bc3d0eb",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/guzzle": "^7.0",
+                "php": "^7.3 | ^8.0",
+                "php-http/httplug": "^2.0",
+                "psr/http-client": "^1.0"
+            },
+            "provide": {
+                "php-http/async-client-implementation": "1.0",
+                "php-http/client-implementation": "1.0",
+                "psr/http-client-implementation": "1.0"
+            },
+            "require-dev": {
+                "php-http/client-integration-tests": "^3.0",
+                "php-http/message-factory": "^1.1",
+                "phpspec/prophecy-phpunit": "^2.0",
+                "phpunit/phpunit": "^8.0|^9.3"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Http\\Adapter\\Guzzle7\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com"
+                }
+            ],
+            "description": "Guzzle 7 HTTP Adapter",
+            "homepage": "http://httplug.io",
+            "keywords": [
+                "Guzzle",
+                "http"
+            ],
+            "support": {
+                "issues": "https://github.com/php-http/guzzle7-adapter/issues",
+                "source": "https://github.com/php-http/guzzle7-adapter/tree/1.1.0"
+            },
+            "time": "2024-11-26T11:14:36+00:00"
+        },
         {
             "name": "php-http/httplug",
             "version": "2.4.1",
             },
             "time": "2024-12-21T16:25:41+00:00"
         },
+        {
+            "name": "typesense/laravel-scout-typesense-driver",
+            "version": "v5.2.9",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/typesense/laravel-scout-typesense-driver.git",
+                "reference": "2032523072a10d5afd12108e2975ba4bc6edb504"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/typesense/laravel-scout-typesense-driver/zipball/2032523072a10d5afd12108e2975ba4bc6edb504",
+                "reference": "2032523072a10d5afd12108e2975ba4bc6edb504",
+                "shasum": ""
+            },
+            "require": {
+                "illuminate/bus": "^7.0|^8.0|^9.0|^10.0|^11.0",
+                "illuminate/contracts": "^7.0|^8.0|^9.0|^10.0|^11.0",
+                "illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0",
+                "illuminate/pagination": "^7.0|^8.0|^9.0|^10.0|^11.0",
+                "illuminate/queue": "^7.0|^8.0|^9.0|^10.0|^11.0",
+                "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0",
+                "laravel/scout": "^8.0|^9.0|^10.0",
+                "php": "^8.0",
+                "typesense/typesense-php": "^4.2"
+            },
+            "require-dev": {
+                "mockery/mockery": "^1.3",
+                "orchestra/testbench": "^6.17|^7.0|^8.0|^9.0",
+                "phpunit/phpunit": "^8.0|^9.0|^10.5",
+                "symfony/http-client": "^5.4|^7.0"
+            },
+            "suggest": {
+                "typesense/typesense-php": "Required to use the Typesense php client."
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "aliases": {
+                        "Typesense": "Typesense\\LaravelTypesense\\TypesenseFacade"
+                    },
+                    "providers": [
+                        "Typesense\\LaravelTypesense\\TypesenseServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Typesense\\LaravelTypesense\\": "src/",
+                    "Typesense\\LaravelTypesense\\Tests\\": "tests/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Abdullah Al-Faqeir",
+                    "email": "abdullah@devloops.net",
+                    "homepage": "https://www.devloops.net",
+                    "role": "Developer"
+                },
+                {
+                    "name": "hi019",
+                    "homepage": "https://github.com/hi019",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Laravel Scout Driver for Typesense",
+            "homepage": "https://typesense.org",
+            "keywords": [
+                "laravel",
+                "search",
+                "typesense"
+            ],
+            "support": {
+                "issues": "https://github.com/typesense/laravel-scout-typesense-driver/issues",
+                "source": "https://github.com/typesense/laravel-scout-typesense-driver/tree/v5.2.9"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/typesense",
+                    "type": "github"
+                }
+            ],
+            "time": "2024-04-07T13:33:52+00:00"
+        },
         {
             "name": "typesense/typesense-php",
-            "version": "v5.0.2",
+            "version": "v4.9.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/typesense/typesense-php.git",
-                "reference": "513270e6a124101c25b03ee27598efd6b87fbec0"
+                "reference": "50fc2089ff4829c8e0e11d8c674e9da085b49998"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/typesense/typesense-php/zipball/513270e6a124101c25b03ee27598efd6b87fbec0",
-                "reference": "513270e6a124101c25b03ee27598efd6b87fbec0",
+                "url": "https://api.github.com/repos/typesense/typesense-php/zipball/50fc2089ff4829c8e0e11d8c674e9da085b49998",
+                "reference": "50fc2089ff4829c8e0e11d8c674e9da085b49998",
                 "shasum": ""
             },
             "require": {
                 "psr/http-message": "^1.0 || ^2.0"
             },
             "require-dev": {
-                "mockery/mockery": "^1.6",
-                "phpunit/phpunit": "^11.2",
                 "squizlabs/php_codesniffer": "3.*",
                 "symfony/http-client": "^5.2"
             },
                     "type": "github"
                 }
             ],
-            "time": "2025-02-24T21:13:28+00:00"
+            "time": "2024-04-29T15:34:34+00:00"
         },
         {
             "name": "vaites/php-apache-tika",
index 551cc93f54fb4d5857280db2bc97ca68c27b3c96..d2cd974da95eddec822a7154681d75af781a07c6 100644 (file)
@@ -182,11 +182,13 @@ return [
          */
         App\Providers\AppServiceProvider::class,
         App\Providers\AuthServiceProvider::class,
-         App\Providers\BroadcastServiceProvider::class,
+        App\Providers\BroadcastServiceProvider::class,
         App\Providers\EventServiceProvider::class,
         App\Providers\HorizonServiceProvider::class,
         App\Providers\NovaServiceProvider::class,
         App\Providers\RouteServiceProvider::class,
+        Typesense\LaravelTypesense\TypesenseServiceProvider::class,
+        Laravel\Scout\ScoutServiceProvider::class,
 
     ],
 
index 0ebbbf5398a8ce9d0470d55549a61b7ba968dae8..be6973937d54dd8ca6acfa6eb4e7d83f2e5ce6df 100644 (file)
@@ -86,9 +86,31 @@ return [
     */
 
     'algolia' => [
-        'id' => env('ALGOLIA_APP_ID', '2DN9N2PQBK'),
-        'secret' => env('ALGOLIA_SECRET', '8a1916ad1188b1b570cb85a43e5be2fa'),
+        'id' => env('ALGOLIA_APP_ID', ''),
+        'secret' => env('ALGOLIA_SECRET', ''),
         'search_key' => env('ALGOLIA_SEARCH_KEY'),
     ],
 
+    'typesense' => [
+        'api_key'         => env('TYPESENSE_API_KEY', 'xyz'),
+        'nodes'           => [
+            [
+                'host'     => env('TYPESENSE_HOST', 'localhost'),
+                'port'     => env('TYPESENSE_PORT', '8108'),
+                'path'     => env('TYPESENSE_PATH', ''),
+                'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
+            ],
+        ],
+        'nearest_node'    => [
+            'host'     => env('TYPESENSE_HOST', 'localhost'),
+            'port'     => env('TYPESENSE_PORT', '8108'),
+            'path'     => env('TYPESENSE_PATH', ''),
+            'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
+        ],
+        'connection_timeout_seconds'   => 2,
+        'healthcheck_interval_seconds' => 30,
+        'num_retries'                  => 3,
+        'retry_interval_seconds'       => 1,
+    ],
+
 ];