Skip to content

Commit 6d54c93

Browse files
committed
Added few tests and some improvements.
1 parent 3116b48 commit 6d54c93

File tree

18 files changed

+196
-103
lines changed

18 files changed

+196
-103
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ trim_trailing_whitespace = true
1111
[*.md]
1212
trim_trailing_whitespace = false
1313

14-
[*.{yml,yaml}]
14+
[*.{yml,yaml,scss}]
1515
indent_size = 2

app/DeploymentLog.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,32 @@ class DeploymentLog extends Model
3131
protected $guarded = [];
3232

3333
/**
34-
* Returns an URL to a page with this log using the Instant View feature of Telegram.
34+
* Returns an URL to a page with this log.
35+
* Uses the Instant View feature of Telegram if instant view hash is set.
3536
*
3637
* @return string
3738
*/
3839
public function getUrlAttribute(): string
3940
{
41+
if (empty(config('services.telegram.instant_view.hash'))) {
42+
return route('deployment-logs.show', [$this]);
43+
}
44+
4045
$query = http_build_query([
4146
'url' => route('deployment-logs.show', [$this]),
4247
'rhash' => config('services.telegram.instant_view.hash'),
4348
]);
4449

4550
return "https://t.me/iv?{$query}";
4651
}
52+
53+
/**
54+
* Returns formatted date.
55+
*
56+
* @return string
57+
*/
58+
public function getFormattedDateAttribute(): string
59+
{
60+
return $this->created_at->toRfc850String();
61+
}
4762
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use App\DeploymentLog;
4+
use Illuminate\Database\Eloquent\Factory;
5+
6+
/*
7+
|--------------------------------------------------------------------------
8+
| Model Factories
9+
|--------------------------------------------------------------------------
10+
|
11+
| This directory should contain each of the model factory definitions for
12+
| your application. Factories provide a convenient way to generate new
13+
| model instances for testing / seeding your application's database.
14+
|
15+
*/
16+
17+
/** @var Factory $factory */
18+
19+
$factory->define(DeploymentLog::class, function () {
20+
return [
21+
'server_name' => 'Test server',
22+
'site_name' => 'Test site',
23+
'content' => "Rendering Complete, saving .css file...\nWrote CSS to /home/forge/example.com/css/style.css\nDone in 2.62s.",
24+
];
25+
});

database/factories/UserFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
22

3-
/** @var \Illuminate\Database\Eloquent\Factory $factory */
4-
53
use App\User;
64
use Faker\Generator as Faker;
7-
use Illuminate\Support\Str;
5+
use Illuminate\Database\Eloquent\Factory;
86

97
/*
108
|--------------------------------------------------------------------------
@@ -17,6 +15,8 @@
1715
|
1816
*/
1917

18+
/** @var Factory $factory */
19+
2020
$factory->define(User::class, function (Faker $faker) {
2121
return [
2222
'name' => $faker->name,

public/css/app.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
51.7 KB
Binary file not shown.

public/mix-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"/css/app.css": "/css/app.css"
3+
}
51.7 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// COLORS
2+
3+
$color-white: #fff;
4+
$color-black: #000;
5+
6+
$color-text-deployment-log-primary: #333;
7+
$color-text-deployment-log-secondary: #79828B;

resources/sass/app.scss

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)