Links
當前用戶創建連結操作
掛載功能
- like/unlike
- favorite/unfavorite
- collect
- tags
CURD Resource
[PUT][AUTH][CURRENT_USER] /api/links/:id
當前登入用戶更新自己建立的連結
validation
- url: required,http/https
request
json
{
"url": "https://yish.dev/posts/backpack-nova-filamentphp/"
}response
json
{
"data": {
"id": 51,
"user_id": "9c645747-6e9f-4d33-bfba-02f2d890e66a",
"host": "https:\/\/yish.dev",
"url": "https:\/\/yish.dev\/posts\/digitalocean-object-sapces-with-laravel\/",
"title": "Digitalocean Object Sapces With Laravel",
"published_at": "2024-06-17T12:08:35.000000Z",
"options": {
"description": "DigitalOcean object spaces 是兼容 AWS S3 的 APIs 服務,並且提供快速配置跟 CDN,收費方面也是較為便宜,主要是可以控制每月的預算花費,而且在設定上相比於 S3 簡單許多,以下是如何將 Spaces 兼容到 Laravel 使用的方法。 DigitalOcean 前置配置 建立 Personal Access Token 建立 Spaces 啟動 CDN 進入 Spaces 頁面,配置 CORS allowed headers Laravel 配置 .env 新建 keys ",
"image": "https:\/\/yish.dev\/1200.png",
"authorName": "Yish",
"providerName": "Yish",
"icon": "https:\/\/yish.dev\/apple-touch-icon.png",
"favicon": "https:\/\/yish.dev\/favicon.ico"
},
"note": null,
"status": "inbox",
"created_at": "2024-06-28T06:57:47.000000Z",
"updated_at": "2024-06-28T06:59:11.000000Z",
"deleted_at": null,
"type": "article",
"user": {
"id": "9c645747-6e9f-4d33-bfba-02f2d890e66a",
"name": "heel",
"email": "h1he111h1eh@tt.com",
"email_verified_at": null,
"two_factor_secret": null,
"two_factor_recovery_codes": null,
"created_at": "2024-06-28T04:09:09.000000Z",
"updated_at": "2024-06-28T04:09:09.000000Z"
}
}
}[POST][AUTH][CURRENT_USER] /api/links
當前用戶建立連結
validation
- url: required,http/https
request
json
{
"url": "https://yish.dev/posts/backpack-nova-filamentphp/"
}response
json
{
"data": {
"user_id": "9c645747-6e9f-4d33-bfba-02f2d890e66a",
"host": "https:\/\/yish.dev",
"url": "https:\/\/yish.dev\/posts\/backpack-nova-filamentphp\/",
"title": "Laravel backpack vs Laravel nova vs FilamentPHP",
"published_at": "2024-06-18T11:37:21.000000Z",
"status": "inbox",
"options": {
"description": "FilamentPHP is a next generation and full stack package (TALL), it’s really great and easy to use for your admin panel and CMS. Laravel backpack In 2016, when I was a SOHO, I used Backpack as my main stack to build projects for my customers. It’s really flexible and customizable if you understand the author’s design philosophy. I could add any packages and functions I wanted into these projects created with Laravel Backpack.",
"image": "https:\/\/yish.dev\/1200.png",
"authorName": "Yish",
"providerName": "Yish",
"icon": "https:\/\/yish.dev\/apple-touch-icon.png",
"favicon": "https:\/\/yish.dev\/favicon.ico"
},
"note": null,
"updated_at": "2024-06-28T06:57:47.000000Z",
"created_at": "2024-06-28T06:57:47.000000Z",
"id": 51,
"type": "article"
}
}[GET][AUTH][CURRENT_USER] /api/links/:id
當前用戶取得自己創建的連結
response
json
{
"data": {
"id": 51,
"user_id": "9c645747-6e9f-4d33-bfba-02f2d890e66a",
"host": "https:\/\/yish.dev",
"url": "https:\/\/yish.dev\/posts\/backpack-nova-filamentphp\/",
"title": "Laravel backpack vs Laravel nova vs FilamentPHP",
"published_at": "2024-06-18T11:37:21.000000Z",
"options": {
"icon": "https:\/\/yish.dev\/apple-touch-icon.png",
"image": "https:\/\/yish.dev\/1200.png",
"favicon": "https:\/\/yish.dev\/favicon.ico",
"authorName": "Yish",
"description": "FilamentPHP is a next generation and full stack package (TALL), it’s really great and easy to use for your admin panel and CMS. Laravel backpack In 2016, when I was a SOHO, I used Backpack as my main stack to build projects for my customers. It’s really flexible and customizable if you understand the author’s design philosophy. I could add any packages and functions I wanted into these projects created with Laravel Backpack.",
"providerName": "Yish"
},
"note": null,
"status": "inbox",
"created_at": "2024-06-28T06:57:47.000000Z",
"updated_at": "2024-06-28T06:57:47.000000Z",
"deleted_at": null,
"type": "article"
}
}[GET][AUTH][CURRENT_USER] /api/links
取得自己創建的連結清單。
response
json
{
"data": [
{
"id": 1,
"user_id": "9c645747-6e9f-4d33-bfba-02f2d890e66a",
"host": "http:\/\/www.luettgen.org\/aspernatur-quos-perspiciatis-et-ut-et-quia-sequi-non",
"url": "http:\/\/schroeder.com\/veritatis-vel-velit-accusamus-laboriosam",
"title": "Voluptatum ex aut id dolorum corrupti.",
"published_at": "2024-06-28T04:10:08.000000Z",
"options": {
"icon": "https:\/\/waters.com\/dolor-dolor-explicabo-vel-commodi-officiis-quisquam.html",
"image": "http:\/\/mills.com\/quas-quo-veritatis-minus-magni",
"favicon": "http:\/\/cremin.com\/officia-quia-quaerat-eaque-nihil-animi-neque-numquam.html",
"authorName": "Haylee Ferry",
"description": "Tempore magni enim iure labore.",
"providerName": "Morar, King and Macejkovic"
},
"note": "Veritatis consectetur et vero voluptates et reiciendis aliquid ipsam in sed magnam at adipisci ipsam ea odit in voluptas eos ex quas pariatur ipsa doloremque ipsam velit ut maxime ut eligendi explicabo eos exercitationem nisi deserunt.",
"status": "inbox",
"created_at": "2024-06-28T04:10:08.000000Z",
"updated_at": "2024-06-28T04:10:08.000000Z",
"deleted_at": null,
"type": "article"
},
{
"id": 2,
"user_id": "9c645747-6e9f-4d33-bfba-02f2d890e66a",
"host": "https:\/\/okon.com\/ut-esse-non-qui-dolorem-deserunt.html",
"url": "http:\/\/yost.com\/",
"title": "Rerum totam et consectetur voluptatum amet quidem repudiandae.",
"published_at": "2024-06-28T04:10:08.000000Z",
"options": {
"icon": "http:\/\/www.metz.com\/",
"image": "https:\/\/bogan.net\/aliquam-nostrum-et-enim-ullam-dolorum-doloribus-totam.html",
"favicon": "http:\/\/www.nader.info\/",
"authorName": "Prof. Hillary Nitzsche",
"description": "Provident vitae tempora officiis illo.",
"providerName": "Ledner, Crona and Abbott"
},
"note": "Autem modi labore voluptatem qui adipisci corporis voluptatem sed accusamus recusandae totam error optio veritatis distinctio ut exercitationem voluptatem quas dolores ad expedita minus tempora doloribus et nihil itaque accusamus odit earum autem aut ea a consequatur nihil qui.",
"status": "inbox",
"created_at": "2024-06-28T04:10:08.000000Z",
"updated_at": "2024-06-28T04:10:08.000000Z",
"deleted_at": null,
"type": "article"
},
],
"links": {
"first": "http:\/\/nordpress-next.test\/api\/links?page=1",
"last": "http:\/\/nordpress-next.test\/api\/links?page=5",
"prev": null,
"next": "http:\/\/nordpress-next.test\/api\/links?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/nordpress-next.test\/api\/links?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/nordpress-next.test\/api\/links?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/nordpress-next.test\/api\/links?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/nordpress-next.test\/api\/links",
"per_page": 10,
"to": 10,
"total": 50
}
}[DELETE][auth] /api/links/:id
刪除自己建立的連結。
response
HTTP_NO_CONTENT = 204
[POST][AUTH][CURRENT_USER] /api/links/:id/notes
為自己建立的連結新增筆記。
validation
- content: required,str
request
json
{
"content": "hello!!"
}response
json
{
"data": {
"user_id": 1,
"content": "hello!!",
"updated_at": "2024-06-30T14:07:35.000000Z",
"created_at": "2024-06-30T14:07:35.000000Z",
"id": 1,
"link": {}
}
}[GET][AUTH][CURRENT_USER] /api/links/:id/notes
取得自己建立的連結的筆記清單。
response
json
{
"data": [
{
"id": 1,
"user_id": 1,
"content": "hello!!",
"created_at": "2024-06-30T14:07:35.000000Z",
"updated_at": "2024-06-30T14:07:35.000000Z",
"deleted_at": null,
"pivot": {
"notable_type": "link",
"notable_id": 1,
"note_id": 1
}
},
{
"id": 2,
"user_id": 1,
"content": "h111ello!!",
"created_at": "2024-06-30T14:10:44.000000Z",
"updated_at": "2024-06-30T14:10:44.000000Z",
"deleted_at": null,
"pivot": {
"notable_type": "link",
"notable_id": 1,
"note_id": 2
}
},
],
"links": {
"first": "http:\/\/nordpress-next.test\/api\/links\/1\/notes?page=1",
"last": "http:\/\/nordpress-next.test\/api\/links\/1\/notes?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/nordpress-next.test\/api\/links\/1\/notes?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http:\/\/nordpress-next.test\/api\/links\/1\/notes",
"per_page": 10,
"to": 3,
"total": 3
}
}[GET][AUTH][CURRENT_USER] /api/links/:id/highlights
取得自己建立的連結的重點清單。
response
json
{
"data": [
{
"id": 1,
"user_id": 1,
"link_id": 1,
"content": "h11321ello!!",
"created_at": "2024-06-30T14:20:50.000000Z",
"updated_at": "2024-06-30T14:20:50.000000Z",
"deleted_at": null
},
{
"id": 2,
"user_id": 1,
"link_id": 1,
"content": "h113s21ello!!",
"created_at": "2024-06-30T14:21:05.000000Z",
"updated_at": "2024-06-30T14:21:05.000000Z",
"deleted_at": null
}
],
"links": {
"first": "http:\/\/nordpress-next.test\/api\/links\/1\/highlights?page=1",
"last": "http:\/\/nordpress-next.test\/api\/links\/1\/highlights?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/nordpress-next.test\/api\/links\/1\/highlights?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http:\/\/nordpress-next.test\/api\/links\/1\/highlights",
"per_page": 10,
"to": 3,
"total": 3
}
}[POST][AUTH][CURRENT_USER] /api/links/:id/highlights
為自己建立的連結新增重點。
validation
- content: required,str
request
json
{
"content": "hello!!"
}response
json
{
"data": {
"user_id": 1,
"content": "h113sasdas21ello!!",
"link_id": 1,
"updated_at": "2024-06-30T14:21:06.000000Z",
"created_at": "2024-06-30T14:21:06.000000Z",
"id": 3
}
}[POST][AUTH][CURRENT_USER] /api/links/:id/favorites/toggle
當前用戶對指定連結收藏/取消收藏。
response
favorite
json
{
"data": {
"attached": [
1
],
"detached": [],
"count": 1
}
}unfavorite
json
{
"data": {
"attached": [],
"detached": [
1
],
"count": 0
}
}[POST][AUTH][CURRENT_USER] /api/links/:id/likes/toggle
當前用戶對指定連結點讚/取消點讚。
response
like
json
{
"data": {
"attached": [
1
],
"detached": [],
"count": 1
}
}unlike
json
{
"data": {
"attached": [],
"detached": [
1
],
"count": 0
}
}