-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
52. app init api
1 parent
b359f89
commit cd5a72c
Showing
3 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ttp/Controllers/Api/ProductController.php → ...p/Controllers/Admin/ProductController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Facades\Cart; | ||
use App\Http\Controllers\Controller; | ||
use App\Models\Favorite; | ||
use Illuminate\Http\JsonResponse; | ||
|
||
class TemporaryController extends Controller | ||
{ | ||
public function appInit(): JsonResponse | ||
{ | ||
$cart = Cart::getCart(); | ||
|
||
return response()->json([ | ||
'cart' => [ | ||
'total_count' => $cart->itemsCount(), | ||
'total_sum' => $cart->getTotalPrice(), | ||
], | ||
'favorites' => [ | ||
'total_count' => Favorite::query()->count(), | ||
'total_sum' => 0, | ||
], | ||
'contacts' => [ | ||
'phone_main' => '+375 (29) 179-37-90', | ||
'phone_by' => '+375 (29) 522-77-22', | ||
'phone_ru' => '8-800-100-77-69', | ||
'email' => config('contacts.email.link'), | ||
'telegram' => config('contacts.telegram.link'), | ||
'telegram_channel' => config('contacts.telegram-channel.link'), | ||
'viber' => config('contacts.viber.link'), | ||
'viber_channel' => config('contacts.viber-channel.link'), | ||
'whats_app' => config('contacts.whats-app.link'), | ||
'instagram' => config('contacts.instagram.link'), | ||
], | ||
'work_time' => 'Ежедневно с 08:00 до 21:00', | ||
]); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters