-
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.
Merge pull request #3 from ARCANESOFT/develop
Adding Laravel 5.4 Support
- Loading branch information
Showing
15 changed files
with
254 additions
and
47 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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/build/ | ||
/vendor/ | ||
/_ide_helper.php | ||
/composer.lock | ||
/composer.phar |
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 ARCANEDEV <[email protected]> - Media For ARCANESOFT | ||
Copyright (c) 2016-2017 ARCANEDEV <[email protected]> - Media For ARCANESOFT | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
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
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\Contracts; | ||
|
||
/** | ||
* Interface Media | ||
* | ||
* @package Arcanesoft\Media\Contracts | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
interface Media | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Get a filesystem adapter. | ||
* | ||
* @param string|null $driver | ||
* | ||
* @return \Illuminate\Contracts\Filesystem\Filesystem | ||
*/ | ||
public function disk($driver = null); | ||
|
||
/** | ||
* Get the default filesystem adapter. | ||
* | ||
* @return \Illuminate\Contracts\Filesystem\Filesystem | ||
*/ | ||
public function defaultDisk(); | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php namespace Arcanesoft\Media\Http\Controllers\Admin; | ||
|
||
use Arcanesoft\Core\Bases\AdminController as BaseController; | ||
use Arcanesoft\Core\Http\Controllers\AdminController; | ||
use Arcanesoft\Core\Traits\Notifyable; | ||
|
||
/** | ||
|
@@ -9,7 +9,7 @@ | |
* @package Arcanesoft\Media\Http\Controllers\Admin | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
abstract class Controller extends BaseController | ||
abstract class Controller extends AdminController | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Traits | ||
|
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
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,39 @@ | ||
<?php namespace Arcanesoft\Media\Http\Routes\Admin; | ||
|
||
use Arcanedev\Support\Routing\RouteRegistrar; | ||
|
||
/** | ||
* Class ApiRoutes | ||
* | ||
* @package Arcanesoft\Media\Http\Routes\Admin | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class ApiRoutes extends RouteRegistrar | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Map routes. | ||
*/ | ||
public function map() | ||
{ | ||
$this->prefix('api')->name('api.')->group(function () { | ||
$this->get('all', 'MediasController@getAll') | ||
->name('get'); // admin::media.api.get | ||
|
||
$this->post('upload', 'MediasController@uploadMedia') | ||
->name('upload'); // admin::media.api.upload | ||
|
||
$this->post('rename', 'MediasController@renameMedia') | ||
->name('rename'); // admin::media.api.rename | ||
|
||
$this->post('delete', 'MediasController@deleteMedia') | ||
->name('delete'); // admin::media.api.delete | ||
|
||
$this->post('create', 'MediasController@createDirectory') | ||
->name('create'); // admin::media.api.create | ||
}); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,50 +1,25 @@ | ||
<?php namespace Arcanesoft\Media\Http\Routes\Admin; | ||
|
||
use Arcanedev\Support\Bases\RouteRegister; | ||
use Illuminate\Contracts\Routing\Registrar; | ||
use Arcanedev\Support\Routing\RouteRegistrar; | ||
|
||
/** | ||
* Class MediaRoutes | ||
* | ||
* @package Arcanesoft\Media\Http\Routes | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class MediaRoutes extends RouteRegister | ||
class MediaRoutes extends RouteRegistrar | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Map routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
*/ | ||
public function map(Registrar $router) | ||
public function map() | ||
{ | ||
// media::foundation.index | ||
$this->get('/', 'MediasController@index')->name('index'); | ||
|
||
$this->registerApiRoutes(); | ||
} | ||
|
||
/** | ||
* Register the media api routes. | ||
*/ | ||
private function registerApiRoutes() | ||
{ | ||
// TODO: Adding ajax middleware | ||
$this->group(['prefix' => 'api', 'as' => 'api.'], function () { | ||
// admin::media.api.get | ||
$this->get('all', 'MediasController@getAll')->name('get'); | ||
// admin::media.api.upload | ||
$this->post('upload', 'MediasController@uploadMedia')->name('upload'); | ||
// admin::media.api.delete | ||
$this->post('rename', 'MediasController@renameMedia')->name('rename'); | ||
// admin::media.api.delete | ||
$this->post('delete', 'MediasController@deleteMedia')->name('delete'); | ||
// admin::media.api.create | ||
$this->post('create', 'MediasController@createDirectory')->name('create'); | ||
}); | ||
$this->get('/', 'MediasController@index') | ||
->name('index'); // 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,90 @@ | ||
<?php namespace Arcanesoft\Media; | ||
|
||
use Arcanesoft\Media\Contracts\Media as MediaContract; | ||
use Illuminate\Contracts\Foundation\Application; | ||
|
||
/** | ||
* Class Media | ||
* | ||
* @package Arcanesoft\Media | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class Media implements MediaContract | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Properties | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* The application instance. | ||
* | ||
* @var \Illuminate\Contracts\Foundation\Application | ||
*/ | ||
protected $app; | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Constructor | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Media constructor. | ||
* | ||
* @param \Illuminate\Contracts\Foundation\Application $app | ||
*/ | ||
public function __construct(Application $app) | ||
{ | ||
$this->app = $app; | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Getters & Setters | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Get the Filesystem Manager instance. | ||
* | ||
* @return \Illuminate\Contracts\Filesystem\Factory | ||
*/ | ||
public function filesystem() | ||
{ | ||
return $this->app->make('filesystem'); | ||
} | ||
|
||
/** | ||
* Get the Config Repository. | ||
* | ||
* @return \Illuminate\Contracts\Config\Repository | ||
*/ | ||
protected function config() | ||
{ | ||
return $this->app->make('config'); | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Get a filesystem adapter. | ||
* | ||
* @param string|null $driver | ||
* | ||
* @return \Illuminate\Contracts\Filesystem\Filesystem | ||
*/ | ||
public function disk($driver = null) | ||
{ | ||
return $this->filesystem()->disk($driver); | ||
} | ||
|
||
/** | ||
* Get the default filesystem adapter. | ||
* | ||
* @return \Illuminate\Contracts\Filesystem\Filesystem | ||
*/ | ||
public function defaultDisk() | ||
{ | ||
return $this->disk( | ||
$this->config()->get('arcanesoft.media.filesystem.default') | ||
); | ||
} | ||
} |
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
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
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
Oops, something went wrong.