Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/issue-2'
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed May 30, 2019
2 parents 9a4de5a + 1fb24e1 commit 35b1a49
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
5 changes: 1 addition & 4 deletions routes/api.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

Route::get('/random/{topic?}', function (Request $request, $topic = null) {
return randomInspire($topic);
});
Route::get('/random/{topic?}', 'InspireController@show');
11 changes: 7 additions & 4 deletions src/CardServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

class CardServiceProvider extends ServiceProvider
{
protected $namespace = 'Kristories\Inspire\Http\Controllers';

/**
* Bootstrap any application services.
*
Expand All @@ -21,8 +23,8 @@ public function boot()
});

Nova::serving(function (ServingNova $event) {
Nova::script('inspire', __DIR__.'/../dist/js/card.js');
Nova::style('inspire', __DIR__.'/../dist/css/card.css');
Nova::script('inspire', __DIR__ . '/../dist/js/card.js');
Nova::style('inspire', __DIR__ . '/../dist/css/card.css');
});
}

Expand All @@ -38,8 +40,9 @@ protected function routes()
}

Route::middleware(['nova'])
->prefix('nova-vendor/inspire')
->group(__DIR__.'/../routes/api.php');
->namespace($this->namespace)
->prefix('nova-vendor/inspire')
->group(__DIR__ . '/../routes/api.php');
}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/Http/Controllers/InspireController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Kristories\Inspire\Http\Controllers;

class InspireController
{
public function show($topic = null)
{
return randomInspire($topic);
}
}

0 comments on commit 35b1a49

Please sign in to comment.