Skip to content

Commit

Permalink
Update routes and failed jobs table
Browse files Browse the repository at this point in the history
  • Loading branch information
dshoreman committed Feb 26, 2021
1 parent e4abcfa commit e72a678
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 40 deletions.
13 changes: 2 additions & 11 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var ?string
*/
protected $namespace = 'Servidor\Http\Controllers';

/**
* The path to the "home" route for your application.
*
Expand Down Expand Up @@ -49,7 +40,7 @@ public function map(): void
protected function mapWebRoutes(): void
{
Route::middleware('web')
->namespace((string) $this->namespace)
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}

Expand All @@ -62,7 +53,7 @@ protected function mapApiRoutes(): void
{
Route::prefix('api')
->middleware('api')
->namespace((string) $this->namespace)
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}
2 changes: 1 addition & 1 deletion config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
*/

'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public function up(): void
{
Schema::create('failed_jobs', function (Blueprint $table): void {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
Expand Down
64 changes: 42 additions & 22 deletions routes/api.php
Original file line number Diff line number Diff line change
@@ -1,48 +1,68 @@
<?php

use Illuminate\Support\Facades\Route;
use Servidor\Http\Controllers\Auth\LoginController;
use Servidor\Http\Controllers\Auth\RegisterController;
use Servidor\Http\Controllers\DatabaseController;
use Servidor\Http\Controllers\FallbackController;
use Servidor\Http\Controllers\Files\CreateNode;
use Servidor\Http\Controllers\Files\DeletePath;
use Servidor\Http\Controllers\Files\EditFile;
use Servidor\Http\Controllers\Files\ListOrShowPath;
use Servidor\Http\Controllers\Files\MovePath;
use Servidor\Http\Controllers\Projects\Applications\PullCode;
use Servidor\Http\Controllers\Projects\Applications\ViewLog;
use Servidor\Http\Controllers\Projects\CreateProject;
use Servidor\Http\Controllers\Projects\ListProjects;
use Servidor\Http\Controllers\Projects\RemoveProject;
use Servidor\Http\Controllers\Projects\UpdateProject;
use Servidor\Http\Controllers\System\Git\ListBranches;
use Servidor\Http\Controllers\System\GroupsController;
use Servidor\Http\Controllers\System\UsersController;
use Servidor\Http\Controllers\SystemInformationController;
use Servidor\Http\Controllers\User\ShowProfile;

Route::post('login', 'Auth\LoginController@login');
Route::post('register', 'Auth\RegisterController@register');
Route::post('login', [LoginController::class, 'login']);
Route::post('register', [RegisterController::class, 'register']);

Route::middleware('auth:api')->group(function (): void {
Route::get('/user', 'User\ShowProfile');
Route::post('logout', 'Auth\LoginController@logout');
Route::get('/user', ShowProfile::class);
Route::post('logout', [LoginController::class, 'logout']);

Route::name('projects.')->prefix('/projects')->group(function (): void {
Route::get('/', Projects\ListProjects::class);
Route::post('/', Projects\CreateProject::class);
Route::put('{project}', Projects\UpdateProject::class);
Route::get('/', ListProjects::class);
Route::post('/', CreateProject::class);
Route::put('{project}', UpdateProject::class);
Route::prefix('{project}/apps/{app}')->group(function (): void {
Route::post('pull', Projects\Applications\PullCode::class);
Route::post('pull', PullCode::class);
});
Route::get('{project}/logs/{log}.app-{app}.log', Projects\Applications\ViewLog::class);
Route::delete('{project}', Projects\RemoveProject::class);
Route::get('{project}/logs/{log}.app-{app}.log', ViewLog::class);
Route::delete('{project}', RemoveProject::class);
});

Route::resource('databases', 'DatabaseController', [
Route::resource('databases', DatabaseController::class, [
'only' => ['index', 'store'],
]);

Route::get('files', Files\ListOrShowPath::class);
Route::put('files', Files\EditFile::class);
Route::post('files', Files\CreateNode::class);
Route::post('files/rename', Files\MovePath::class);
Route::delete('files', Files\DeletePath::class);
Route::get('files', ListOrShowPath::class);
Route::put('files', EditFile::class);
Route::post('files', CreateNode::class);
Route::post('files/rename', MovePath::class);
Route::delete('files', DeletePath::class);

Route::name('system')->prefix('/system')->namespace('System')->group(function (): void {
Route::get('git/branches', Git\ListBranches::class);
Route::name('system')->prefix('/system')->group(function (): void {
Route::get('git/branches', ListBranches::class);

Route::resource('groups', 'GroupsController', [
Route::resource('groups', GroupsController::class, [
'only' => ['index', 'store', 'update', 'destroy'],
]);

Route::resource('users', 'UsersController', [
Route::resource('users', UsersController::class, [
'only' => ['index', 'store', 'update', 'destroy'],
]);
});

Route::get('system-info', 'SystemInformationController');
Route::get('system-info', SystemInformationController::class);
});

Route::any('/{all?}', 'FallbackController@api')->where('all', '.*');
Route::any('/{all?}', [FallbackController::class, 'api'])->where('all', '.*');
16 changes: 10 additions & 6 deletions routes/web.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?php

use Illuminate\Support\Facades\Route;
use Servidor\Http\Controllers\Auth\ForgotPasswordController;
use Servidor\Http\Controllers\Auth\ResetPasswordController;
use Servidor\Http\Controllers\Auth\VerificationController;
use Servidor\Http\Controllers\FallbackController;

// Auth routes copied from Illuminate\Routing\Router@auth
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
Route::get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify');
Route::get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
Route::post('password/email', [ForgotPasswordController::class, 'sendResetLinkEmail'])->name('password.email');
Route::post('password/reset', [ResetPasswordController::class, 'reset'])->name('password.update');
Route::get('email/verify', [VerificationController::class, 'show'])->name('verification.notice');
Route::get('email/verify/{id}/{hash}', [VerificationController::class, 'verify'])->name('verification.verify');
Route::get('email/resend', [VerificationController::class, 'resend'])->name('verification.resend');

Route::fallback('FallbackController@frontend');
Route::fallback([FallbackController::class, 'frontend']);

0 comments on commit e72a678

Please sign in to comment.