소스 검색

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) {
if ($supplier->supplier != 'smmkings') {
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' =>
config("services.smmkings.key"), 'action' => 'add',
'service' => $supplier->supplier_id, 'link' =>
$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;
}



+ 11
- 0
resources/views/master.blade.php 파일 보기

@@ -7,6 +7,17 @@
<link rel="stylesheet" href="">
<link rel="shortcut icon" type="image/jpg" href="/img/arrow-up.svg"/>
<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
<title>Trendplays - @yield('title')</title>
</head>


불러오는 중...
취소
저장