diff --git a/app/Models/Brand.php b/app/Models/Brand.php index 4d00da6..d173a09 100755 --- a/app/Models/Brand.php +++ b/app/Models/Brand.php @@ -63,8 +63,12 @@ class Brand extends Model { if (!empty($this->image)) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::url($this->image); - }; + return Storage::temporaryUrl( + $this->image, + Date::now()->addMinutes(5) + ); + } + ; return (string) '/' . $this->image; } diff --git a/app/Models/Category.php b/app/Models/Category.php index 1b98b7e..4be5934 100755 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -53,7 +53,7 @@ class Category extends Model 'title_seo' => 'array', 'is_filter_power' => 'boolean' ]; - + protected $appends = ['image_url']; protected $hidden = [ @@ -148,7 +148,10 @@ class Category extends Model { if (!in_array($this->image, ['null', null])) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::url($this->image); + return Storage::temporaryUrl( + $this->image, + Date::now()->addMinutes(5) + ); } return config('app.url') . '/' . $this->image; diff --git a/app/Models/Post.php b/app/Models/Post.php index 4d3e374..99d41dc 100755 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -56,11 +56,14 @@ class Post extends Model public function getImage(): string { if (!empty($this->image)) { - if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::url($this->image); + if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { + return Storage::temporaryUrl( + $this->image, + Date::now()->addMinutes(5) + ); } - return config('app.url') . '/' . $this->image; + return $this->image; } return '/images/nophoto.jpg'; diff --git a/app/Models/Product.php b/app/Models/Product.php index 4f1ca13..b954c06 100755 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -237,7 +237,10 @@ class Product extends Model { if (!empty($this->poster)) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::url($this->poster); + return Storage::temporaryUrl( + $this->poster, + Date::now()->addMinutes(5) + ); } return config('app.url') . '/' . $this->poster; } @@ -249,7 +252,10 @@ class Product extends Model { if (!empty($this->data_sheet) and ($this->data_sheet != null and $this->data_sheet != "null")) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::url($this->data_sheet); + return Storage::temporaryUrl( + $this->data_sheet, + Date::now()->addMinutes(5) + ); } return config('app.url') . '/' . $this->data_sheet; } @@ -260,7 +266,10 @@ class Product extends Model { if (!empty($this->poster_thumb)) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::url($this->poster_thumb); + return Storage::temporaryUrl( + $this->poster_thumb, + Date::now()->addMinutes(5) + ); } return config('app.url') . '/' . $this->poster_thumb; } @@ -299,10 +308,10 @@ class Product extends Model $when = $beginning ? 1 : 0; if ($rate == 0) { - return - ($future_value + $present_value) / $periods; + return -($future_value + $present_value) / $periods; } - return - ($future_value + ($present_value * pow(1 + $rate, $periods))) + return -($future_value + ($present_value * pow(1 + $rate, $periods))) / ((1 + $rate * $when) / $rate * (pow(1 + $rate, $periods) - 1)); } diff --git a/app/Models/Slider.php b/app/Models/Slider.php index e4de03a..e6f7572 100755 --- a/app/Models/Slider.php +++ b/app/Models/Slider.php @@ -45,10 +45,13 @@ class Slider extends Model public function getImage(): string { if (!empty($this->image)) { - if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::url($this->image); + if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { + return Storage::temporaryUrl( + $this->image, + Date::now()->addMinutes(5) + ); } - return config('app.url') . '/' . $this->image; + return $this->image; } return '/images/nophoto.jpg'; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 5135035..8f02e94 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -26,7 +26,7 @@ class AppServiceProvider extends ServiceProvider date_default_timezone_set('Asia/Tashkent'); // set lang to uz if (App::environment(['staging', 'production'])) { - URL::forceScheme('https'); + URL::forceScheme('http'); } } } diff --git a/config/filesystems.php b/config/filesystems.php index fd8194d..e33a624 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -62,7 +62,6 @@ return [ 'region' => env('MINIO_REGION', 'us-east-1'), // Your MinIO region, typically 'us-east-1' 'bucket' => env('MINIO_BUCKET'), // The name of your bucket 'endpoint' => env('MINIO_ENDPOINT'), // MinIO server endpoint - 'url' => env('MINIO_URL'), // Public URL for the browser 'use_path_style_endpoint' => env('MINIO_USE_PATH_STYLE', true), // MinIO path-style support 'visibility' => 'public', // Set the visibility (public/private) 'signature_version' => 'v4', // Add this line diff --git a/public/uploads/posters/thumbs/2026/04/15/Ctm9COGSnGZPquRABp8qM9GZKW6wPCQCvW3IKI3E.png b/public/uploads/posters/thumbs/2026/04/15/Ctm9COGSnGZPquRABp8qM9GZKW6wPCQCvW3IKI3E.png new file mode 100644 index 0000000..76ae4d5 Binary files /dev/null and b/public/uploads/posters/thumbs/2026/04/15/Ctm9COGSnGZPquRABp8qM9GZKW6wPCQCvW3IKI3E.png differ diff --git a/public/uploads/posters/thumbs/2026/04/15/Ze1zJ3apyIF4rjH00lXKK23fgoCLEQWMn6MKfgst.png b/public/uploads/posters/thumbs/2026/04/15/Ze1zJ3apyIF4rjH00lXKK23fgoCLEQWMn6MKfgst.png new file mode 100644 index 0000000..9373340 Binary files /dev/null and b/public/uploads/posters/thumbs/2026/04/15/Ze1zJ3apyIF4rjH00lXKK23fgoCLEQWMn6MKfgst.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/1z7DQ3ziJFVOlVGvzElTwL2aXWWDtYzF61LixioZ.png b/public/uploads/screens/thumbs/2026/04/15/1z7DQ3ziJFVOlVGvzElTwL2aXWWDtYzF61LixioZ.png new file mode 100644 index 0000000..d723c24 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/1z7DQ3ziJFVOlVGvzElTwL2aXWWDtYzF61LixioZ.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/B4uXCzKqL43LVAz13QGnTMafM3Fn22q65bEmon7w.png b/public/uploads/screens/thumbs/2026/04/15/B4uXCzKqL43LVAz13QGnTMafM3Fn22q65bEmon7w.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/B4uXCzKqL43LVAz13QGnTMafM3Fn22q65bEmon7w.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/H2V3Saik79M8HlifpXHutCajtres7Amb1aC8oVuS.png b/public/uploads/screens/thumbs/2026/04/15/H2V3Saik79M8HlifpXHutCajtres7Amb1aC8oVuS.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/H2V3Saik79M8HlifpXHutCajtres7Amb1aC8oVuS.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/HJ1uzuygylQjH7sG3Mex8LJl61zvOYiunqNfwmmz.png b/public/uploads/screens/thumbs/2026/04/15/HJ1uzuygylQjH7sG3Mex8LJl61zvOYiunqNfwmmz.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/HJ1uzuygylQjH7sG3Mex8LJl61zvOYiunqNfwmmz.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/QNW5AgJpCdDgCQ3wAbrRByFv57aopJA42lqXMjKp.png b/public/uploads/screens/thumbs/2026/04/15/QNW5AgJpCdDgCQ3wAbrRByFv57aopJA42lqXMjKp.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/QNW5AgJpCdDgCQ3wAbrRByFv57aopJA42lqXMjKp.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/QmM1PtOOlYKHW1CzqBGWtL9lxmXQF5xUfx5Rqizn.png b/public/uploads/screens/thumbs/2026/04/15/QmM1PtOOlYKHW1CzqBGWtL9lxmXQF5xUfx5Rqizn.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/QmM1PtOOlYKHW1CzqBGWtL9lxmXQF5xUfx5Rqizn.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/SQ93hPleeImFaEnMOsn1DhJe9K012JqxG7AlStn7.png b/public/uploads/screens/thumbs/2026/04/15/SQ93hPleeImFaEnMOsn1DhJe9K012JqxG7AlStn7.png new file mode 100644 index 0000000..6c07f7e Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/SQ93hPleeImFaEnMOsn1DhJe9K012JqxG7AlStn7.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/UZPpDf0Wx1o7JS99TxhtckfhGsbL1DSXIkpsjtBf.png b/public/uploads/screens/thumbs/2026/04/15/UZPpDf0Wx1o7JS99TxhtckfhGsbL1DSXIkpsjtBf.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/UZPpDf0Wx1o7JS99TxhtckfhGsbL1DSXIkpsjtBf.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/bNc5aJd4AVhTHhN7kukPv3z6L4ygO7eOFVIdc0OY.png b/public/uploads/screens/thumbs/2026/04/15/bNc5aJd4AVhTHhN7kukPv3z6L4ygO7eOFVIdc0OY.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/bNc5aJd4AVhTHhN7kukPv3z6L4ygO7eOFVIdc0OY.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/h3DIGulSf5hD2gr94kHltzBF6ctj9jRGSjbbZfkS.png b/public/uploads/screens/thumbs/2026/04/15/h3DIGulSf5hD2gr94kHltzBF6ctj9jRGSjbbZfkS.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/h3DIGulSf5hD2gr94kHltzBF6ctj9jRGSjbbZfkS.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/pQwpd9ivioZHkinLPihwJ1d4cQCeQ5hW2XpPdVsZ.png b/public/uploads/screens/thumbs/2026/04/15/pQwpd9ivioZHkinLPihwJ1d4cQCeQ5hW2XpPdVsZ.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/pQwpd9ivioZHkinLPihwJ1d4cQCeQ5hW2XpPdVsZ.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/qCrpcaGTDOiX7FAolzmeEhL6qI3s2mBS7caHdyJO.png b/public/uploads/screens/thumbs/2026/04/15/qCrpcaGTDOiX7FAolzmeEhL6qI3s2mBS7caHdyJO.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/qCrpcaGTDOiX7FAolzmeEhL6qI3s2mBS7caHdyJO.png differ diff --git a/public/uploads/screens/thumbs/2026/04/15/sPcBhoEthLBeSb3VjL2GutFVbY04EVUr0jAycbzK.png b/public/uploads/screens/thumbs/2026/04/15/sPcBhoEthLBeSb3VjL2GutFVbY04EVUr0jAycbzK.png new file mode 100644 index 0000000..40830d5 Binary files /dev/null and b/public/uploads/screens/thumbs/2026/04/15/sPcBhoEthLBeSb3VjL2GutFVbY04EVUr0jAycbzK.png differ