-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProof.php
More file actions
91 lines (77 loc) · 2.42 KB
/
Copy pathProof.php
File metadata and controls
91 lines (77 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
declare(strict_types=1);
/**
* Anchor Framework
*
* Proof.
*
* @author BenIyke <beniyke34@gmail.com> | Twitter: @BigBeniyke
*/
namespace Proof;
use Proof\Models\CaseStudy;
use Proof\Models\ProofRequest;
use Proof\Models\Source;
use Proof\Models\Testimonial;
use Proof\Services\AnalyticsManagerService;
use Proof\Services\Builders\CaseStudyBuilder;
use Proof\Services\Builders\TestimonialBuilder;
use Proof\Services\ProofManagerService;
/**
* Static proxy for the Proof package.
*/
class Proof
{
/**
* Start building a new testimonial.
*/
public static function testimonial(?Testimonial $testimonial = null): TestimonialBuilder
{
return resolve(ProofManagerService::class)->testimonial($testimonial);
}
/**
* Start building a new case study.
*/
public static function caseStudy(?CaseStudy $caseStudy = null): CaseStudyBuilder
{
return resolve(CaseStudyBuilder::class)->setInstance($caseStudy);
}
public static function createSource(array $data): Source
{
return resolve(ProofManagerService::class)->createSource($data);
}
public static function findTestimonial(int $id): ?Testimonial
{
return resolve(ProofManagerService::class)->findTestimonial($id);
}
public static function approve(int|string $id): bool
{
return resolve(ProofManagerService::class)->approve((int) $id);
}
public static function reject(int|string $id): bool
{
return resolve(ProofManagerService::class)->reject((int) $id);
}
/**
* Attach media.
*/
public static function attachMedia(Testimonial|CaseStudy $model, int $mediaId, string $type = 'photo'): void
{
resolve(ProofManagerService::class)->attachMedia($model, $mediaId, $type);
}
public static function request(Source $source): ProofRequest
{
return resolve(ProofManagerService::class)->createRequest($source);
}
public static function collectionUrl(ProofRequest $request): string
{
return resolve(ProofManagerService::class)->generateCollectionUrl($request);
}
public static function fromSubmission(object $submission, array $mapping = []): ?Testimonial
{
return resolve(ProofManagerService::class)->fromStackSubmission($submission, $mapping);
}
public static function analytics(): AnalyticsManagerService
{
return resolve(AnalyticsManagerService::class);
}
}