-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #60 from tomatophp/develop
Circle
- Loading branch information
Showing
157 changed files
with
4,870 additions
and
183 deletions.
There are no files selected for viewing
Binary file not shown.
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
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 @@ | ||
github: [3x1io] |
Empty file.
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,63 @@ | ||
<?php | ||
|
||
namespace Modules\CircleDocs\App\Console; | ||
|
||
use Illuminate\Console\Command; | ||
use Modules\CircleApps\App\Models\App; | ||
use TomatoPHP\ConsoleHelpers\Traits\RunCommand; | ||
|
||
class CircleDocsInstall extends Command | ||
{ | ||
use RunCommand; | ||
|
||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'circle-docs:install'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'install package and publish assets'; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$this->info('Install App'); | ||
$app = App::where('key', 'circle-docs')->first(); | ||
if(!$app){ | ||
$app = new App(); | ||
$app->key = 'circle-docs'; | ||
$app->name = 'Circle Docs'; | ||
$app->description = 'Create and share, search in your docs using markdown editor and GitHub integration'; | ||
$app->is_active = true; | ||
$app->is_free = true; | ||
$app->status = "active"; | ||
$app->homepage = "https://www.github.com/tomatophp/circle-docs"; | ||
$app->github = "https://www.github.com/tomatophp/circle-docs"; | ||
$app->docs = "https://www.github.com/tomatophp/circle-docs"; | ||
$app->privacy = "https://www.github.com/tomatophp/circle-docs"; | ||
$app->faq = "https://www.github.com/tomatophp/circle-docs"; | ||
$app->email = "[email protected]"; | ||
$app->save(); | ||
} | ||
$this->callSilent('optimize:clear'); | ||
$this->artisanCommand(["migrate"]); | ||
$this->artisanCommand(["optimize:clear"]); | ||
$this->info('Circle Contacts App installed successfully.'); | ||
} | ||
} |
Empty file.
Empty file.
81 changes: 81 additions & 0 deletions
81
Modules/CircleDocs/App/Http/Controllers/CircleDocsController.php
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,81 @@ | ||
<?php | ||
|
||
namespace Modules\CircleDocs\App\Http\Controllers; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Models\Account; | ||
use Illuminate\Http\RedirectResponse; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Response; | ||
use Modules\CircleDocs\App\Models\CircleXoDoc; | ||
|
||
class CircleDocsController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index(Request $request) | ||
{ | ||
$query = CircleXoDoc::query(); | ||
$query->where('is_public', true); | ||
if($request->has('search') && $request->input('search') != ''){ | ||
$query->where('name', 'like', '%'.$request->input('search').'%')->orWhere('package', 'like', '%'.$request->input('search').'%'); | ||
} | ||
$query->where('is_public', true); | ||
$query = $query->paginate(12); | ||
|
||
return view('circle-docs::index', [ | ||
'docs' => $query | ||
]); | ||
} | ||
|
||
public function profile($username) | ||
{ | ||
$account = Account::where('username', $username)->firstOrFail(); | ||
if($account){ | ||
$query = CircleXoDoc::query(); | ||
$query->where('account_id', $account->id); | ||
$query->where('is_public', true); | ||
$query = $query->paginate(12); | ||
|
||
return view('circle-docs::profile', [ | ||
'docs' => $query, | ||
'account' => $account | ||
]); | ||
} | ||
} | ||
|
||
/** | ||
* Show the specified resource. | ||
*/ | ||
public function show($username, $slug) | ||
{ | ||
$account = Account::where('username', $username)->firstOrFail(); | ||
if($account){ | ||
$doc = CircleXoDoc::where('package', $slug)->where('account_id', $account->id)->firstOrFail(); | ||
return view('circle-docs::show', [ | ||
'doc' => $doc, | ||
'account' => $account | ||
]); | ||
} | ||
} | ||
|
||
/** | ||
* Show the specified resource. | ||
*/ | ||
public function page($username, $slug, $page) | ||
{ | ||
$account = Account::where('username', $username)->firstOrFail(); | ||
if($account){ | ||
$doc = CircleXoDoc::where('package', $slug)->where('account_id', $account->id)->firstOrFail(); | ||
if($doc){ | ||
$page = $doc->pages()->where('slug', $page)->firstOrFail(); | ||
return view('circle-docs::show', [ | ||
'doc' => $doc, | ||
'currentPage' => $page, | ||
'account' => $account | ||
]); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.