mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
back/forward buttons, fix timestamps in DB
This commit is contained in:
parent
3c618a2209
commit
733f0aa228
79 changed files with 171 additions and 6904 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
|
@ -81,6 +81,7 @@ class Tip extends Model
|
|||
'avatar' => $tweet->author->profile_image_url,
|
||||
])->username,
|
||||
'images' => array_map(fn (TwitterImage $image) => $image->url, $tweet->images),
|
||||
'created_at' => $tweet->created_at,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Twitter;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
/**
|
||||
|
|
@ -14,18 +15,21 @@ class Tweet
|
|||
public TwitterUser $author;
|
||||
public ?string $threadId = null;
|
||||
public array $images = [];
|
||||
public Carbon $created_at;
|
||||
|
||||
public function __construct(
|
||||
string $id,
|
||||
string $text,
|
||||
TwitterUser $author,
|
||||
?string $threadId = null,
|
||||
Carbon $created_at,
|
||||
array $images = [],
|
||||
) {
|
||||
$this->id = $id;
|
||||
$this->text = $text;
|
||||
$this->author = $author;
|
||||
$this->threadId = $threadId;
|
||||
$this->created_at = $created_at;
|
||||
$this->images = $images;
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +40,7 @@ class Tweet
|
|||
->withToken(config('services.twitter.token'))
|
||||
->get('https://api.twitter.com/2/tweets/' . $id, [
|
||||
'media.fields' => 'url',
|
||||
'tweet.fields' => 'conversation_id,entities',
|
||||
'tweet.fields' => 'conversation_id,entities,created_at',
|
||||
'user.fields' => 'profile_image_url',
|
||||
'expansions' => 'attachments.media_keys,author_id',
|
||||
]);
|
||||
|
|
@ -66,6 +70,7 @@ class Tweet
|
|||
$author['profile_image_url'],
|
||||
),
|
||||
$response->json('data.conversation_id'),
|
||||
Carbon::make($response->json('data.created_at')),
|
||||
array_map(fn (string $url) => new TwitterImage($url), $response->json('includes.media.*.url', [])),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
46
composer.lock
generated
46
composer.lock
generated
|
|
@ -895,16 +895,16 @@
|
|||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v8.35.1",
|
||||
"version": "v8.36.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "d118c0df39e7524131176aaf76493eae63a8a602"
|
||||
"reference": "0debd8ad6b5aa1f61ccc73910adf049af4ca0444"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/d118c0df39e7524131176aaf76493eae63a8a602",
|
||||
"reference": "d118c0df39e7524131176aaf76493eae63a8a602",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/0debd8ad6b5aa1f61ccc73910adf049af4ca0444",
|
||||
"reference": "0debd8ad6b5aa1f61ccc73910adf049af4ca0444",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1059,7 +1059,7 @@
|
|||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2021-03-30T21:34:17+00:00"
|
||||
"time": "2021-04-07T12:37:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
|
|
@ -2440,16 +2440,16 @@
|
|||
},
|
||||
{
|
||||
"name": "ryangjchandler/orbit",
|
||||
"version": "v0.7.2",
|
||||
"version": "v0.7.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ryangjchandler/orbit.git",
|
||||
"reference": "b01f1d8c28586410ce3bf3c3ada9c131e03b9ff9"
|
||||
"reference": "2636eb680e96a3cd4e2a911e44df3850f4e90518"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ryangjchandler/orbit/zipball/b01f1d8c28586410ce3bf3c3ada9c131e03b9ff9",
|
||||
"reference": "b01f1d8c28586410ce3bf3c3ada9c131e03b9ff9",
|
||||
"url": "https://api.github.com/repos/ryangjchandler/orbit/zipball/2636eb680e96a3cd4e2a911e44df3850f4e90518",
|
||||
"reference": "2636eb680e96a3cd4e2a911e44df3850f4e90518",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2496,7 +2496,7 @@
|
|||
"description": "A flat-file database driver for Eloquent.",
|
||||
"support": {
|
||||
"issues": "https://github.com/ryangjchandler/orbit/issues",
|
||||
"source": "https://github.com/ryangjchandler/orbit/tree/v0.7.2"
|
||||
"source": "https://github.com/ryangjchandler/orbit/tree/v0.7.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -2504,7 +2504,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-03-29T13:10:29+00:00"
|
||||
"time": "2021-04-04T21:29:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/yaml-front-matter",
|
||||
|
|
@ -4883,16 +4883,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify/git-wrapper",
|
||||
"version": "v9.2.12",
|
||||
"version": "v9.2.14",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symplify/git-wrapper.git",
|
||||
"reference": "ab372196b2925900d94f06bd97c73deb0654bc94"
|
||||
"reference": "790b91b137bb26eaebe8f56a6961883439874f71"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symplify/git-wrapper/zipball/ab372196b2925900d94f06bd97c73deb0654bc94",
|
||||
"reference": "ab372196b2925900d94f06bd97c73deb0654bc94",
|
||||
"url": "https://api.github.com/repos/symplify/git-wrapper/zipball/790b91b137bb26eaebe8f56a6961883439874f71",
|
||||
"reference": "790b91b137bb26eaebe8f56a6961883439874f71",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -4905,7 +4905,7 @@
|
|||
"ondram/ci-detector": "^3.5",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"psr/log": "^1.1",
|
||||
"symplify/smart-file-system": "^9.2.12"
|
||||
"symplify/smart-file-system": "^9.2.14"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
|
|
@ -4924,7 +4924,7 @@
|
|||
"git wrapper"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symplify/git-wrapper/tree/v9.2.12"
|
||||
"source": "https://github.com/symplify/git-wrapper/tree/v9.2.14"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -4936,7 +4936,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-03-19T11:24:34+00:00"
|
||||
"time": "2021-03-22T13:11:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "tijsverkoyen/css-to-inline-styles",
|
||||
|
|
@ -5658,16 +5658,16 @@
|
|||
},
|
||||
{
|
||||
"name": "laravel/sail",
|
||||
"version": "v1.4.10",
|
||||
"version": "v1.4.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/sail.git",
|
||||
"reference": "4f0b2bac128ee60a11d9758651f103f78157474a"
|
||||
"reference": "e46a3228da4e95a411a981ac807bd119ab2485fa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/sail/zipball/4f0b2bac128ee60a11d9758651f103f78157474a",
|
||||
"reference": "4f0b2bac128ee60a11d9758651f103f78157474a",
|
||||
"url": "https://api.github.com/repos/laravel/sail/zipball/e46a3228da4e95a411a981ac807bd119ab2485fa",
|
||||
"reference": "e46a3228da4e95a411a981ac807bd119ab2485fa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -5714,7 +5714,7 @@
|
|||
"issues": "https://github.com/laravel/sail/issues",
|
||||
"source": "https://github.com/laravel/sail"
|
||||
},
|
||||
"time": "2021-03-30T21:26:44+00:00"
|
||||
"time": "2021-04-06T14:00:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mockery/mockery",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ slug: 1-rt-1-tip
|
|||
title: '1 RT = 1 tip'
|
||||
tweet_id: 1308082888324374528
|
||||
author_username: samuelstancl
|
||||
created_at: 2021-04-06T16:07:39+00:00
|
||||
created_at: 2021-04-07T18:16:23+00:00
|
||||
---
|
||||
A thread of misc tips, originally one tip per one retweet.
|
||||
|
|
@ -3,6 +3,6 @@ slug: laravel-clean-code-tactics
|
|||
title: 'Laravel Clean Code Tactics'
|
||||
tweet_id: 1272822437181378561
|
||||
author_username: samuelstancl
|
||||
created_at: 2021-04-06T16:07:22+00:00
|
||||
created_at: 2021-04-07T18:16:07+00:00
|
||||
---
|
||||
Get the PDF versions [here](https://gum.co/laravel-clean-code)
|
||||
The OG thread. Get printable PDF versions [here](https://gum.co/laravel-clean-code).
|
||||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean2CnyWoAEZ3Ef.jpg'
|
||||
created_at: 2021-04-06T16:07:28+00:00
|
||||
created_at: 2020-06-16T09:24:56+00:00
|
||||
slug: avoid-helper-classes
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean7jvPWkAAp2_6.jpg'
|
||||
created_at: 2021-04-06T16:07:36+00:00
|
||||
created_at: 2020-06-16T09:40:48+00:00
|
||||
slug: avoid-queries-in-blade-when-possible
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean6t2ZXgAEiJMa.jpg'
|
||||
created_at: 2021-04-06T16:07:34+00:00
|
||||
created_at: 2020-06-16T09:40:46+00:00
|
||||
slug: be-friends-with-your-ide
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidAtSYXgAc-6tH.png'
|
||||
created_at: 2021-04-06T16:07:41+00:00
|
||||
created_at: 2020-09-21T16:48:18+00:00
|
||||
slug: closure-validation-rules-are-theyre-often-better-than-creating-a-class-just-for-a-single-use
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidZs1IWAAUgH0m.png'
|
||||
created_at: 2021-04-06T16:07:44+00:00
|
||||
created_at: 2020-09-21T18:38:04+00:00
|
||||
slug: comparing-changes-on-saving-using
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean6Sn9XkAA-WKS.png'
|
||||
created_at: 2021-04-06T16:07:34+00:00
|
||||
created_at: 2020-06-16T09:40:45+00:00
|
||||
slug: consider-single-action-controllers
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean0kWgXgAAcOXm.jpg'
|
||||
created_at: 2021-04-06T16:07:26+00:00
|
||||
created_at: 2020-06-16T09:24:55+00:00
|
||||
slug: consider-using-form-requests
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean7QGBXYAEt_l2.jpg'
|
||||
created_at: 2021-04-06T16:07:35+00:00
|
||||
created_at: 2020-06-16T09:40:47+00:00
|
||||
slug: consider-using-helpers-instead-of-facades-they-can-clean-things-up
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean8vC0WAAEomIq.jpg'
|
||||
created_at: 2021-04-06T16:07:38+00:00
|
||||
created_at: 2020-06-16T09:40:51+00:00
|
||||
slug: context-matters
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean0gvIWsAAIfxK.jpg'
|
||||
created_at: 2021-04-06T16:07:26+00:00
|
||||
created_at: 2020-06-16T09:24:54+00:00
|
||||
slug: create-action-classes
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean7bYSXkAIwDIR.png'
|
||||
created_at: 2021-04-06T16:07:35+00:00
|
||||
created_at: 2020-06-16T09:40:48+00:00
|
||||
slug: create-custom-blade-directives-for-business-logic
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean3zqXWAAASnOP.png'
|
||||
created_at: 2021-04-06T16:07:29+00:00
|
||||
created_at: 2020-06-16T09:24:58+00:00
|
||||
slug: create-fluent-objects
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean1ow4WoAAFjoT.jpg'
|
||||
created_at: 2021-04-06T16:07:27+00:00
|
||||
created_at: 2020-06-16T09:24:56+00:00
|
||||
slug: create-helper-functions
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean0WGiWAAAg4cu.jpg'
|
||||
created_at: 2021-04-06T16:07:25+00:00
|
||||
created_at: 2020-06-16T09:24:54+00:00
|
||||
slug: create-model-methods-for-business-logic
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean5ymtXgAEvlxm.jpg'
|
||||
created_at: 2021-04-06T16:07:32+00:00
|
||||
created_at: 2020-06-16T09:40:43+00:00
|
||||
slug: create-query-scopes-for-complex-wheres
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ tweet_id: '1272826427902234625'
|
|||
thread_slug: laravel-clean-code-tactics
|
||||
author_username: samuelstancl
|
||||
images: { }
|
||||
created_at: 2021-04-06T16:07:31+00:00
|
||||
created_at: 2020-06-16T09:40:43+00:00
|
||||
slug: create-single-use-blade-includes
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean5BnEWkAEPUTe.jpg'
|
||||
created_at: 2021-04-06T16:07:31+00:00
|
||||
created_at: 2020-06-16T09:25:01+00:00
|
||||
slug: create-single-use-traits
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean0HJwWAAAZkDR.png'
|
||||
created_at: 2021-04-06T16:07:24+00:00
|
||||
created_at: 2020-06-16T09:24:53+00:00
|
||||
slug: create-variables-when-they-improve-readability
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ tweet_id: '1272822460631539712'
|
|||
thread_slug: laravel-clean-code-tactics
|
||||
author_username: samuelstancl
|
||||
images: { }
|
||||
created_at: 2021-04-06T16:07:28+00:00
|
||||
created_at: 2020-06-16T09:24:57+00:00
|
||||
slug: dedicate-a-weekend-towards-learning-proper-oop
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eanz9WJWkAAeoT2.jpg'
|
||||
created_at: 2021-04-06T16:07:24+00:00
|
||||
created_at: 2020-06-16T09:24:53+00:00
|
||||
slug: dont-create-variables-when-you-can-just-pass-the-value-directly
|
||||
---
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean2u-YX0AEmwEd.jpg'
|
||||
created_at: 2021-04-06T16:07:28+00:00
|
||||
created_at: 2020-06-16T09:24:57+00:00
|
||||
slug: dont-just-write-procedural-code-in-classes
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eanz0jnXsAAvkv1.jpg'
|
||||
created_at: 2021-04-06T16:07:23+00:00
|
||||
created_at: 2020-06-16T09:24:52+00:00
|
||||
slug: dont-split-lines-at-random-places-but-dont-make-them-too-long-either
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean6NFJX0AAfiXT.png'
|
||||
created_at: 2021-04-06T16:07:33+00:00
|
||||
created_at: 2020-06-16T09:40:45+00:00
|
||||
slug: dont-use-a-controller-namespace
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean4TBBXgAAMab3.png'
|
||||
created_at: 2021-04-06T16:07:30+00:00
|
||||
created_at: 2020-06-16T09:24:59+00:00
|
||||
slug: dont-use-abbreviations
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean58GjWAAAgqLq.jpg'
|
||||
created_at: 2021-04-06T16:07:32+00:00
|
||||
created_at: 2020-06-16T09:40:44+00:00
|
||||
slug: dont-use-model-methods-to-retrieve-data
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidaLtrXcAU0nIG.png'
|
||||
created_at: 2021-04-06T16:07:45+00:00
|
||||
created_at: 2020-09-21T18:43:42+00:00
|
||||
slug: eloquent-listeners-are-awesome
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidbX_UWAAMeB6-.png'
|
||||
created_at: 2021-04-06T16:07:45+00:00
|
||||
created_at: 2020-09-21T18:43:43+00:00
|
||||
slug: example-checking-a-parent-relationship-for-some-things
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidbEGZXYAA6q3G.png'
|
||||
created_at: 2021-04-06T16:07:45+00:00
|
||||
created_at: 2020-09-21T18:43:42+00:00
|
||||
slug: example-deleting-associated-files-on-deletion
|
||||
---
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean1UORWkAE4UDD.jpg'
|
||||
created_at: 2021-04-06T16:07:27+00:00
|
||||
created_at: 2020-06-16T09:24:55+00:00
|
||||
slug: extract-methods
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ tweet_id: '1272826456960315392'
|
|||
thread_slug: laravel-clean-code-tactics
|
||||
author_username: samuelstancl
|
||||
images: { }
|
||||
created_at: 2021-04-06T16:07:37+00:00
|
||||
created_at: 2020-06-16T09:40:49+00:00
|
||||
slug: have-a-single-source-of-truth-for-validation-rules
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidDSDcXYAA_7XD.jpg'
|
||||
created_at: 2021-04-06T16:07:42+00:00
|
||||
created_at: 2020-09-21T17:00:00+00:00
|
||||
slug: heres-another-example-of-the-model-state-stuff-mentioned-above
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ author_username: LiamHammett
|
|||
images:
|
||||
- 'https://pbs.twimg.com/media/EiXw7FcXYAEGzFy.jpg'
|
||||
- 'https://pbs.twimg.com/media/EiXw7h3WAAEjT9F.jpg'
|
||||
created_at: 2021-04-06T16:07:48+00:00
|
||||
created_at: 2020-09-20T16:20:30+00:00
|
||||
slug: if-you-didnt-know-at-laravellivewire-now-triggers-updated-and-updating-hooks-for-nested-properties-which-works-with-both-array-and-model-properties
|
||||
---
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ author_username: samuelstancl
|
|||
images:
|
||||
- 'https://pbs.twimg.com/media/Edb2vN0XoAEnunt.png'
|
||||
- 'https://pbs.twimg.com/media/Edb2vO8WoAAAcdX.png'
|
||||
created_at: 2021-04-06T16:07:42+00:00
|
||||
created_at: 2020-07-21T08:05:30+00:00
|
||||
slug: if-you-dont-like-the-double-indentation-of-vue-data-you-can-use-arrow-functions
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ author_username: samuelstancl
|
|||
images:
|
||||
- 'https://pbs.twimg.com/media/EidKFFnX0AEEjwr.png'
|
||||
- 'https://pbs.twimg.com/media/EidKYlkWoAAWkLD.png'
|
||||
created_at: 2021-04-06T16:07:43+00:00
|
||||
created_at: 2020-09-21T17:30:36+00:00
|
||||
slug: if-you-want-to-identify-teams-workspaces-etc-by-path-you-dont-have-to-pass-the-team-id-to-every-route
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidXEVXXgAofRdr.jpg'
|
||||
created_at: 2021-04-06T16:07:44+00:00
|
||||
created_at: 2020-09-21T18:24:57+00:00
|
||||
slug: if-youre-debugging-your-app-and-youd-like-to-examine-more-things-eg-the-stack-trace-executed-queries-app-context
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean5otqXYAA4QPR.png'
|
||||
created_at: 2021-04-06T16:07:31+00:00
|
||||
created_at: 2020-06-16T09:40:43+00:00
|
||||
slug: import-namespaces-instead-of-using-aliases
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EanzWiHXsAAhshs.jpg'
|
||||
created_at: 2021-04-06T16:07:22+00:00
|
||||
created_at: 2020-06-16T09:24:52+00:00
|
||||
slug: instead-of-writing-repetitive-else-if-statements-use-an-array-to-look-up-the-wanted-value-based-on-the-key-you-have
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ tweet_id: '1272822438406094848'
|
|||
thread_slug: laravel-clean-code-tactics
|
||||
author_username: samuelstancl
|
||||
images: { }
|
||||
created_at: 2021-04-06T16:07:22+00:00
|
||||
created_at: 2020-06-16T09:24:51+00:00
|
||||
slug: its-about-the-micro
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ tweet_id: '1308126491188883463'
|
|||
thread_slug: 1-rt-1-tip
|
||||
author_username: samuelstancl
|
||||
images: { }
|
||||
created_at: 2021-04-06T16:07:46+00:00
|
||||
created_at: 2020-09-21T19:30:33+00:00
|
||||
slug: laravel-migrations-have-a-very-nice-syntax-for-foreign-keys
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidABmBXcAAto9_.png'
|
||||
created_at: 2021-04-06T16:07:41+00:00
|
||||
created_at: 2020-09-21T16:44:47+00:00
|
||||
slug: laravel-nova-lets-you-show-different-resourcestoolscards-based-on-an-if-check
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidI3vCXgAIOCvY.png'
|
||||
created_at: 2021-04-06T16:07:43+00:00
|
||||
created_at: 2020-09-21T17:24:29+00:00
|
||||
slug: laravel-telescope-is-great-for-so-many-things
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eic5sfxWAAY2ym2.png'
|
||||
created_at: 2021-04-06T16:07:39+00:00
|
||||
created_at: 2020-09-21T16:37:18+00:00
|
||||
slug: people-underutilize-the-exception-handler
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidBy75XsA4CZGx.jpg'
|
||||
created_at: 2021-04-06T16:07:41+00:00
|
||||
created_at: 2020-09-21T16:52:14+00:00
|
||||
slug: relevant-for-people-building-packages
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eic9xP2XsAoo8ay.png'
|
||||
created_at: 2021-04-06T16:07:40+00:00
|
||||
created_at: 2020-09-21T16:37:19+00:00
|
||||
slug: theres-great-value-in-understanding-how-object-state-of-models-works-this-is-mostly-relevant-in-feature-tests-because-they-touch-many-parts-of-your-codebase-in-one-phplaravel-app-state
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidvI20XcAA7MGY.png'
|
||||
created_at: 2021-04-06T16:07:48+00:00
|
||||
created_at: 2020-09-21T20:10:31+00:00
|
||||
slug: this-one-is-less-obscure
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eidq5A3XsAAM9lA.png'
|
||||
created_at: 2021-04-06T16:07:46+00:00
|
||||
created_at: 2020-09-21T20:00:49+00:00
|
||||
slug: this-wont-fit-into-one-tweet-but-theres-so-much-cool-stuff-you-can-do-with-eloquent
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EanzmPwXYAAoH2A.jpg'
|
||||
created_at: 2021-04-06T16:07:23+00:00
|
||||
created_at: 2020-06-16T09:24:52+00:00
|
||||
slug: try-to-avoid-unnecessary-nesting-by-returning-a-value-early
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean8WekXkAEafMW.png'
|
||||
created_at: 2021-04-06T16:07:37+00:00
|
||||
created_at: 2020-06-16T09:40:50+00:00
|
||||
slug: use-collections-when-they-can-clean-up-your-code
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean3-8QXYAAmi7V.jpg'
|
||||
created_at: 2021-04-06T16:07:30+00:00
|
||||
created_at: 2020-06-16T09:24:59+00:00
|
||||
slug: use-custom-collections
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean6FxnXkAAXDsl.png'
|
||||
created_at: 2021-04-06T16:07:33+00:00
|
||||
created_at: 2020-06-16T09:40:44+00:00
|
||||
slug: use-custom-config-files
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean3uMaWAAApBhb.jpg'
|
||||
created_at: 2021-04-06T16:07:29+00:00
|
||||
created_at: 2020-06-16T09:24:58+00:00
|
||||
slug: use-data-transfer-objects-dtos
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean8DcIXkAESZ_P.jpg'
|
||||
created_at: 2021-04-06T16:07:37+00:00
|
||||
created_at: 2020-06-16T09:40:49+00:00
|
||||
slug: use-docblocks-only-when-they-clarify-things
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean07-jXkAErgaL.jpg'
|
||||
created_at: 2021-04-06T16:07:26+00:00
|
||||
created_at: 2020-06-16T09:24:55+00:00
|
||||
slug: use-events
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean4xcqWAAUsjdG.png'
|
||||
created_at: 2021-04-06T16:07:30+00:00
|
||||
created_at: 2020-06-16T09:25:00+00:00
|
||||
slug: use-expressive-names-for-methods
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean63YeXQAABhBd.jpg'
|
||||
created_at: 2021-04-06T16:07:34+00:00
|
||||
created_at: 2020-06-16T09:40:46+00:00
|
||||
slug: use-short-operators
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean722QXgAENwmW.jpg'
|
||||
created_at: 2021-04-06T16:07:36+00:00
|
||||
created_at: 2020-06-16T09:40:48+00:00
|
||||
slug: use-strict-comparison
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: timacdonald87
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EWVoC3jVcAEg0JX.jpg'
|
||||
created_at: 2021-04-06T16:07:49+00:00
|
||||
created_at: 2020-04-24T03:23:18+00:00
|
||||
slug: wanna-update-a-set-of-eloquent-models-and-have-the-change-updated-in-the-database-and-in-your-in-memory-instances-but-dont-wanna-incur-a-database-query-for-each-model
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eic_JawXgAAEbYL.png'
|
||||
created_at: 2021-04-06T16:07:40+00:00
|
||||
created_at: 2020-09-21T16:42:13+00:00
|
||||
slug: when-a-relationship-is-already-loaded-and-cached-on-the-model-instance-youll-have-to-refresh-it
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EinfW11XgAE0y7W.jpg'
|
||||
created_at: 2021-04-06T16:07:49+00:00
|
||||
created_at: 2020-09-23T17:40:43+00:00
|
||||
slug: when-im-converting-data-into-a-different-structure-one-thing-i-like-to-do-is-annotate-how-the-structure-looks-at-each-point-of-the-process
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: laravel-clean-code-tactics
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Ean8cQUWoAEjdO3.jpg'
|
||||
created_at: 2021-04-06T16:07:38+00:00
|
||||
created_at: 2020-06-16T09:40:51+00:00
|
||||
slug: write-functional-code-when-it-benefits-you
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: reinink
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/ERyNRSIX0AEjjWo.jpg'
|
||||
created_at: 2021-04-06T16:07:49+00:00
|
||||
created_at: 2020-02-27T13:12:31+00:00
|
||||
slug: yesterday-in-my-at-laracononline-talk-i-explained-how-to-use-the-query-builder-when-method-to-handle-complex-sorting
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidtAYaXkAEjAl-.jpg'
|
||||
created_at: 2021-04-06T16:07:47+00:00
|
||||
created_at: 2020-09-21T20:00:50+00:00
|
||||
slug: you-can-add-a-tags-method-to-a-job-anything-you-return-from-this-method-will-be-displayed-in-horizon
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidrdqwWkAIy4oN.png'
|
||||
created_at: 2021-04-06T16:07:47+00:00
|
||||
created_at: 2020-09-21T20:00:49+00:00
|
||||
slug: you-can-create-dynamic-relationships-this-relationship-is-based-on-a-column-thats-added-using-a-subquery-in-a-scope
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidyDmfWsAI14-C.png'
|
||||
created_at: 2021-04-06T16:07:48+00:00
|
||||
created_at: 2020-09-21T20:24:49+00:00
|
||||
slug: you-can-explicitly-bind-objects-to-routes-you-dont-have-to-use-route-model-binding-only-custom-objects-work-perfectly-well-too
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eidmle3WoAI72Yk.png'
|
||||
created_at: 2021-04-06T16:07:46+00:00
|
||||
created_at: 2020-09-21T19:32:43+00:00
|
||||
slug: you-can-return-false-from-a-ing-eloquent-event-listener-creating-updating-saving-deleting-to-cancel-the-action
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/Eic6iydX0AgLupY.png'
|
||||
created_at: 2021-04-06T16:07:40+00:00
|
||||
created_at: 2020-09-21T16:37:19+00:00
|
||||
slug: you-can-return-mailables-as-responses-from-controllers-it-will-show-the-rendered-version-in-the-browser
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ thread_slug: 1-rt-1-tip
|
|||
author_username: samuelstancl
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/EidOOuTXYAYMtI9.png'
|
||||
created_at: 2021-04-06T16:07:43+00:00
|
||||
created_at: 2020-09-21T17:46:34+00:00
|
||||
slug: you-can-use-wherexandy-in-eloquent
|
||||
---
|
||||
|
||||
|
|
|
|||
1728
public/css/app.css
vendored
1728
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
5043
public/js/app.js
vendored
5043
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/app.js": "/js/app.js?id=dcd6a25505aca8a1b0cb",
|
||||
"/css/app.css": "/css/app.css?id=a4be474b1dff83dbf938"
|
||||
"/js/app.js": "/js/app.js?id=1c9c0a8a53dbb967504e",
|
||||
"/css/app.css": "/css/app.css?id=c60a02d22bf509a5d74d"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,19 +52,14 @@ $title = $title ? $title . ' | Laravel Code Tips' : 'Laravel Code Tips';
|
|||
|
||||
<footer class="py-12 border-t">
|
||||
<ul class="px-4 space-y-4 text-center text-gray-500">
|
||||
<li>
|
||||
Found an error? Contact us at
|
||||
<x-link href="mailto:hello@laravel-code.tips">support@laravel-code.tips</x-link>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Want to share a tip? Submit it
|
||||
<x-link target="_blank" href="https://github.com/stancl/laravel-tips">here</x-link>
|
||||
<x-link href="https://github.com/stancl/laravel-tips">here</x-link>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Designed with <span class="text-red-500">❤️</span> by
|
||||
<x-link target="_blank" href="http://twitter.com/larsKlopstra/">@larsklopstra</x-link>
|
||||
<x-link target="_blank" href="http://twitter.com/LarsKlopstra">Lars Klopstra</x-link>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,32 @@
|
|||
<ul class="inline-grid grid-flow-col gap-4">
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $twitter }}">Twitter</a>
|
||||
</li>
|
||||
<div class="inline-flex flex-col">
|
||||
<ul class="inline-grid grid-flow-col gap-4">
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $twitter }}">Twitter</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $telegram }}">Telegram</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $telegram }}">Telegram</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $newsletter }}">Newsletter</a>
|
||||
</li>
|
||||
</ul>
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $newsletter }}">Newsletter</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/" class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900">
|
||||
All tips
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,40 @@
|
|||
<x:layout>
|
||||
<div
|
||||
class="fixed inset-0 z-40 items-center justify-between hidden w-full h-screen p-16 pointer-events-none lg:flex">
|
||||
<a class="rounded-full shadow-md pointer-events-auto" href="#">
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a class="rounded-full shadow-md pointer-events-auto" href="#">
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
{{-- Left button = newer --}}
|
||||
@if($link = $tip->newQuery()->orderBy('created_at', 'asc')->firstWhere('created_at', '>', $tip->created_at))
|
||||
<a
|
||||
class="rounded-full shadow-md pointer-events-auto"
|
||||
href="{{ route('tip.show', $link, false) }}"
|
||||
>
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
@else
|
||||
<div>
|
||||
{{-- Placeholder for positioning of the right button --}}
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
{{-- Right button = older --}}
|
||||
@if($link = $tip->newQuery()->orderBy('created_at', 'desc')->firstWhere('created_at', '<', $tip->created_at))
|
||||
<a
|
||||
class="rounded-full shadow-md pointer-events-auto"
|
||||
href="{{ route('tip.show', $link, false) }}"
|
||||
>
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<main class="relative flex-1 py-24">
|
||||
|
|
@ -41,7 +58,7 @@
|
|||
@endif
|
||||
|
||||
@if ($tip->content)
|
||||
<div class="prose break-all md:prose-xl">
|
||||
<div class="prose break-words md:prose-xl">
|
||||
{!! Str::markdown($tip->content) !!}
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue