Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Dillingham committed Apr 29, 2019
2 parents c5335b2 + 23e806f commit cb8e5b4
Showing 1 changed file with 43 additions and 38 deletions.
81 changes: 43 additions & 38 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,10 @@ class RecentUsers extends ListCard
- Latest resource / oldest resource
- Upcoming / past due resources
- Top resource by relationship count
- Top resource by relationship sum
- Top resource by relationship's column sum

### Available Methods

| Method | Description |
| - | - |
| resource() | declare the resource |
| heading() | add a title to card |
| subtitle() | display subtitle value |
| timestamp() | display & format timestamp |
| value() | display right side value |
| withCount() | aggregate count value |
| withSum() | aggregate sum value |
| orderBy() | set the resource order |
| limit() | set number of resources |
| viewAll() | enable view all link |
| viewAllLens() | enable lens view all |
| footerLink()| add a static footer link |
| zebra() | add alternate row color |
| classes() | add css classes to card |

**Headings**
**Card Heading**

```php
->heading('Top Bloggers')
Expand Down Expand Up @@ -98,36 +80,25 @@ Relative timestamps: `5 days ago` | `in 5 days`
->timestamp('completed_at', 'relative'),
```

**Limit**

Set the number of items to display, default: 5:
```php
->limit(3)
```

**OrderBy**

Set the order of the resources:
```php
->orderBy('scheduled_at', 'desc')
```

**Side Values**

Display resource values on the right side
```php
->value('city'),
```

**Aggregated Values**
**Aggregated Count**

Add counts of relationships:
```php
->resource(Category::class)
->withCount('posts')
->value('category_posts'),
```
Add sum of relationship column:

**Aggregated Sum**

Add sum of relationship's column:
```php
->resource(User::class)
->withSum('orders', 'total')
Expand All @@ -144,9 +115,23 @@ Format: 55.2k insread of 55200
-value('orders_sum', '0.0a') // 55.2k
-value('orders_sum', '($ 0.00 a)') // $55.2k
```
Timestamp: add third parameter
Timestamp: add third parameter for [moment.js formats](https://momentjs.com/docs/#/displaying/format/)
```php
->value('created_at', 'mm/dd'', 'timestamp')
->value('created_at', 'MM/DD'', 'timestamp')
```

**Limit**

Set the number of items to display, default: 5:
```php
->limit(3)
```

**OrderBy**

Set the order of the resources:
```php
->orderBy('scheduled_at', 'desc')
```

**Show View All Link**
Expand Down Expand Up @@ -249,3 +234,23 @@ You can also add alternate row formatting
->viewAllLens('top-opportunities')
->orderBy('opportunities_sum', 'desc'),
```

### Methods

| Method | Description |
| - | - |
| resource() | declare the resource |
| heading() | add a title to card |
| subtitle() | display subtitle value |
| timestamp() | display & format timestamp |
| value() | display right side value |
| withCount() | aggregate count value |
| withSum() | aggregate sum value |
| orderBy() | set the resource order |
| limit() | set number of resources |
| viewAll() | enable view all link |
| viewAllLens() | enable lens view all |
| footerLink()| add a static footer link |
| zebra() | add alternate row color |
| id() | unique id for card's requests |
| classes() | add css classes to card |

0 comments on commit cb8e5b4

Please sign in to comment.