Переглянути джерело

Add analytics tags

master
Immanuel Onyeka 3 роки тому
джерело
коміт
139dd0ec17
2 змінених файлів з 29 додано та 0 видалено
  1. +18
    -0
      app/Http/Controllers/Supply.php
  2. +11
    -0
      resources/views/master.blade.php

+ 18
- 0
app/Http/Controllers/Supply.php Переглянути файл

@@ -121,16 +121,34 @@ class Supply extends Controller
} }




//Should check that cost is not greater than price and store order
//information if completed. return false/NULL if an error occured
public static function orderSmmkings($order, $supplier) { public static function orderSmmkings($order, $supplier) {
if ($supplier->supplier != 'smmkings') { if ($supplier->supplier != 'smmkings') {
return false; return false;
} }


//Check that the order is not already pending. Probably by calling
//another function.
//Check supplier cost here to make sure the request is a good idea

$response = Http::post(config("services.smmkings.link"), ['key' => $response = Http::post(config("services.smmkings.link"), ['key' =>
config("services.smmkings.key"), 'action' => 'add', config("services.smmkings.key"), 'action' => 'add',
'service' => $supplier->supplier_id, 'link' => 'service' => $supplier->supplier_id, 'link' =>
$order->url, 'quantity' => $order->quantity])->json(); $order->url, 'quantity' => $order->quantity])->json();


//This should log the error for later reporting
if (array_key_exists('error', $response)){
return
}

//store order information here

$status = Http::post(config("services.smmkings.link"), ['key' =>
config("services.smmkings.key"), 'action' => 'status',
'order' => $response['order']])->json();

return $response; return $response;
} }




+ 11
- 0
resources/views/master.blade.php Переглянути файл

@@ -7,6 +7,17 @@
<link rel="stylesheet" href=""> <link rel="stylesheet" href="">
<link rel="shortcut icon" type="image/jpg" href="/img/arrow-up.svg"/> <link rel="shortcut icon" type="image/jpg" href="/img/arrow-up.svg"/>
<link rel="stylesheet" href="/css/app.css"> <link rel="stylesheet" href="/css/app.css">
@if (config('app.env') == 'production')
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-LH36E9P3P5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-LH36E9P3P5');
</script>
@endif
@show @show
<title>Trendplays - @yield('title')</title> <title>Trendplays - @yield('title')</title>
</head> </head>


Завантаження…
Відмінити
Зберегти