-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1cf19c
commit a6447b4
Showing
13 changed files
with
440 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
return [ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Route | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
'route' => [ | ||
'prefix' => 'media', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
use Arcanesoft\Auth\Models\Role; | ||
use Arcanesoft\Auth\Policies; | ||
|
||
return [ | ||
'title' => 'Media', | ||
'name' => 'media', | ||
'route' => 'media::foundation.index', | ||
'icon' => 'fa fa-fw fa-picture-o', | ||
'roles' => [Role::ADMINISTRATOR], | ||
'permissions' => [], | ||
'children' => [ | ||
// | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@section('header') | ||
<h1><i class="fa fa-fw fa-picture-o"></i> Media</h1> | ||
@endsection | ||
|
||
@section('content') | ||
@endsection | ||
|
||
@section('modals') | ||
@endsection | ||
|
||
@section('scripts') | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php namespace Arcanesoft\Media\Http\Controllers; | ||
|
||
use Arcanesoft\Core\Bases\FoundationController as BaseController; | ||
use Arcanesoft\Core\Traits\Notifyable; | ||
|
||
/** | ||
* Class Controller | ||
* | ||
* @package Arcanesoft\Auth\Http\Controllers\Foundation | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
abstract class Controller extends BaseController | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Traits | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
use Notifyable; | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Properties | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* The view namespace. | ||
* | ||
* @var string | ||
*/ | ||
protected $viewNamespace = 'media'; | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Constructor | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Instantiate the controller. | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->addBreadcrumbRoute('Media', 'media::foundation.index'); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php namespace Arcanesoft\Media\Http\Controllers; | ||
|
||
/** | ||
* Class MediasController | ||
* | ||
* @package Arcanesoft\Media\Http\Controllers | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class MediasController extends Controller | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Constructor | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* MediasController constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->setCurrentPage('media'); | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
public function index() | ||
{ | ||
$this->setTitle('Media'); | ||
|
||
return $this->view('manager'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php namespace Arcanesoft\Media\Http\Routes; | ||
|
||
use Arcanedev\Support\Bases\RouteRegister; | ||
use Illuminate\Contracts\Routing\Registrar; | ||
|
||
/** | ||
* Class MediaRoutes | ||
* | ||
* @package Arcanesoft\Media\Http\Routes | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class MediaRoutes extends RouteRegister | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Map routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
*/ | ||
public function map(Registrar $router) | ||
{ | ||
$this->get('/', [ | ||
'as' => 'index', // media::foundation.index | ||
'uses' => 'MediasController@index', | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php namespace Arcanesoft\Media; | ||
|
||
use Arcanesoft\Core\Bases\PackageServiceProvider; | ||
use Arcanesoft\Core\CoreServiceProvider; | ||
|
||
/** | ||
* Class MediaServiceProvider | ||
* | ||
* @package Arcanesoft\Media | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class MediaServiceProvider extends PackageServiceProvider | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Properties | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Package name. | ||
* | ||
* @var string | ||
*/ | ||
protected $package = 'media'; | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Getters & Setters | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Get the base path of the package. | ||
* | ||
* @return string | ||
*/ | ||
public function getBasePath() | ||
{ | ||
return dirname(__DIR__); | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Register the service provider. | ||
*/ | ||
public function register() | ||
{ | ||
$this->registerConfig(); | ||
$this->registerSidebarItems(); | ||
$this->app->register(CoreServiceProvider::class); | ||
$this->app->register(Providers\PackagesServiceProvider::class); | ||
$this->app->register(Providers\AuthorizationServiceProvider::class); | ||
|
||
if ($this->app->runningInConsole()) { | ||
$this->app->register(Providers\CommandServiceProvider::class); | ||
} | ||
} | ||
|
||
/** | ||
* Boot the service provider. | ||
*/ | ||
public function boot() | ||
{ | ||
$this->app->register(Providers\RouteServiceProvider::class); | ||
|
||
// Publishes | ||
$this->publishConfig(); | ||
$this->publishViews(); | ||
$this->publishTranslations(); | ||
$this->publishSidebarItems(); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php namespace Arcanesoft\Media\Providers; | ||
|
||
use Arcanedev\Support\ServiceProvider; | ||
|
||
class AuthorizationServiceProvider extends ServiceProvider | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php namespace Arcanesoft\Media\Providers; | ||
|
||
use Arcanedev\Support\ServiceProvider; | ||
|
||
class CommandServiceProvider extends ServiceProvider | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php namespace Arcanesoft\Media\Providers; | ||
|
||
use Arcanedev\Support\ServiceProvider; | ||
|
||
class PackagesServiceProvider extends ServiceProvider | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php namespace Arcanesoft\Media\Providers; | ||
|
||
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider; | ||
use Arcanesoft\Media\Http\Routes; | ||
use Illuminate\Contracts\Routing\Registrar as Router; | ||
use Illuminate\Support\Arr; | ||
|
||
class RouteServiceProvider extends ServiceProvider | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Getters & Setters | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Get the routes namespace | ||
* | ||
* @return string | ||
*/ | ||
protected function getRouteNamespace() | ||
{ | ||
return 'Arcanesoft\\Auth\\Http\\Routes'; | ||
} | ||
|
||
/** | ||
* Get the auth foundation route prefix. | ||
* | ||
* @return string | ||
*/ | ||
public function getFoundationAuthPrefix() | ||
{ | ||
$prefix = Arr::get($this->getFoundationRouteGroup(), 'prefix', 'dashboard'); | ||
|
||
return "$prefix/" . config('arcanesoft.media.route.prefix', 'media'); | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Define the routes for the application. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
*/ | ||
public function map(Router $router) | ||
{ | ||
$this->mapFoundationRoutes($router); | ||
} | ||
|
||
private function mapFoundationRoutes(Router $router) | ||
{ | ||
$attributes = array_merge($this->getFoundationRouteGroup(), [ | ||
'as' => 'media::foundation.', | ||
'namespace' => 'Arcanesoft\\Media\\Http\\Controllers', | ||
]); | ||
|
||
$router->group(array_merge( | ||
$attributes, | ||
['prefix' => $this->getFoundationAuthPrefix()] | ||
), function (Router $router) { | ||
Routes\MediaRoutes::register($router); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php namespace Arcanesoft\Media\Tests; | ||
|
||
/** | ||
* Class MediaServiceProviderTest | ||
* | ||
* @package Arcanesoft\Media\Tests | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class MediaServiceProviderTest extends TestCase | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Properties | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** @var \Arcanesoft\Media\MediaServiceProvider */ | ||
protected $provider; | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$this->provider = $this->app->getProvider(\Arcanesoft\Media\MediaServiceProvider::class); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
unset($this->provider); | ||
|
||
parent::tearDown(); | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Test Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** @test */ | ||
public function it_can_be_instantiated() | ||
{ | ||
$expectations = [ | ||
\Illuminate\Support\ServiceProvider::class, | ||
\Arcanedev\Support\ServiceProvider::class, | ||
\Arcanedev\Support\PackageServiceProvider::class, | ||
\Arcanesoft\Core\Bases\PackageServiceProvider::class, | ||
\Arcanesoft\Media\MediaServiceProvider::class, | ||
]; | ||
|
||
foreach ($expectations as $expected) { | ||
$this->assertInstanceOf($expected, $this->provider); | ||
} | ||
} | ||
|
||
/** @test */ | ||
public function it_can_provides() | ||
{ | ||
$expected = [ | ||
// | ||
]; | ||
|
||
$this->assertSame($expected, $this->provider->provides()); | ||
} | ||
} |
Oops, something went wrong.