Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from BrokerExchange/feature/1.0
Browse files Browse the repository at this point in the history
Feature/1.0
  • Loading branch information
Jantho1990 authored Jun 28, 2018
2 parents 6fc0876 + 8467403 commit dff568d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
14 changes: 8 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ A Laravel package which adds the ability to create "showcases", or view boxes wh
## Todos:
- get to 1.0
- add the admin section
- create components for dropping in the view boxes
- ~add the admin section~
- ~create components for dropping in the view boxes~
- add sort order functionality within displays for trophies
- unit tests
- show trophies associated with a display on the show form
- show displays associated with a trophy on the show form
- automate including the assets in the test project
- add validation rule for checking template files
- ~add validation rule for checking template files~
- finish adding flash messages for CRUD
- Vue multiselect for trophy display select
- combine with sort order selection
Expand All @@ -22,14 +22,16 @@ A Laravel package which adds the ability to create "showcases", or view boxes wh
- Replace buttons with FontAwesome icons where appropriate
- add ability to use a custom auth guard
- add image uploader that takes care of uploading images to the CDN
- add way to mass-assign trophies to a display (instead of one at a time)
- ~add way to mass-assign trophies to a display (instead of one at a time)~
- add Trophy Groups
- and the ability to assign all Trophy Group members to a Display
- add Display Groups
- and the ability to assign a new Trophy to all Displays in a group

## Installation

### Install the package

> This is not on Packagist yet, so these instructions don't work!
```
composer require brokerexchange/showcase
```
Expand Down
6 changes: 2 additions & 4 deletions src/Showcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ class Showcase
public static function display($display)
{
if (!is_string($display)) {
$errMsg = "with id \"$display\"";
$display = \Showcase\App\Display::where('id', $display)->first();
} else {
$errMsg = "with name \"$display\"";
$display = \Showcase\App\Display::where('name', $display)->first();
}

if ($display->count() === 0) {
throw new \Exception("Showcase display component view $errMsg does not exist.");
if ($display === null) {
return '';
}

return $display;
Expand Down
6 changes: 5 additions & 1 deletion src/app/Providers/ShowcaseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public function boot()
], 'showcase-assets');

Blade::directive('showcaseDisplay', function ($display) {
return "<?php \$__env->startComponent(\"showcase::public.components.display.{$display}->component_view\", ['display' => {$display}]); ?><?php echo \$__env->renderComponent(); ?>";
return "<?php
if ({$display} !== '') {
\$__env->startComponent(\"showcase::public.components.display.{$display}->component_view\", ['display' => {$display}]);
echo \$__env->renderComponent();
} ?>";
});

Blade::directive('showcaseTrophy', function ($expression) {
Expand Down

0 comments on commit dff568d

Please sign in to comment.