Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
SadTomCat committed May 1, 2021
2 parents 0457839 + 5b152b6 commit 68d5034
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 57 deletions.
2 changes: 1 addition & 1 deletion app/Broadcasting/SearchGameChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function join(User $user, $id)
$alreadySearch = array_search($id, $val, true);
$notInGame = GameService::notInGame($user);

if (!$logged || $alreadySearch !== false || !$notInGame) {
if ($logged === false || $alreadySearch !== false || $notInGame === false) {
return false;
}

Expand Down
3 changes: 0 additions & 3 deletions app/Events/GameEndEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
Expand Down
2 changes: 0 additions & 2 deletions app/Events/GameNewMessageEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
namespace App\Events;

use App\Models\User;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
Expand Down
2 changes: 0 additions & 2 deletions app/Events/GameNotStartedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
Expand Down
1 change: 0 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Providers;

use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;

class AuthServiceProvider extends ServiceProvider
{
Expand Down
43 changes: 10 additions & 33 deletions routes/auth.php
Original file line number Diff line number Diff line change
@@ -1,55 +1,32 @@
<?php

use App\Http\Controllers\Auth\AuthenticatedSessionController;
use App\Http\Controllers\Auth\ConfirmablePasswordController;
use App\Http\Controllers\Auth\EmailVerificationNotificationController;
use App\Http\Controllers\Auth\EmailVerificationPromptController;
use App\Http\Controllers\Auth\NewPasswordController;
use App\Http\Controllers\Auth\PasswordResetLinkController;
use App\Http\Controllers\Auth\RegisteredUserController;
use App\Http\Controllers\Auth\VerifyEmailController;
use Illuminate\Support\Facades\Route;

Route::post('/register', [RegisteredUserController::class, 'store'])
->middleware('guest');
->middleware('guest');

Route::post('/login', [AuthenticatedSessionController::class, 'store'])
->middleware('guest');
->middleware('guest');

Route::post('/user-logged', [AuthenticatedSessionController::class, 'userLogged'])
->middleware('auth');

Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])
->middleware('guest')
->name('password.email');
->middleware('guest')
->name('password.email');

Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])
->middleware('guest')
->name('password.reset');
->middleware('guest')
->name('password.reset');

Route::post('/reset-password', [NewPasswordController::class, 'store'])
->middleware('guest')
->name('password.update');

//Route::get('/verify-email', [EmailVerificationPromptController::class, '__invoke'])
// ->middleware('auth')
// ->name('verification.notice');
//
//Route::get('/verify-email/{id}/{hash}', [VerifyEmailController::class, '__invoke'])
// ->middleware(['auth', 'signed', 'throttle:6,1'])
// ->name('verification.verify');
//
//Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
// ->middleware(['auth', 'throttle:6,1'])
// ->name('verification.send');
//
//Route::get('/confirm-password', [ConfirmablePasswordController::class, 'show'])
// ->middleware('auth')
// ->name('password.confirm');
//
//Route::post('/confirm-password', [ConfirmablePasswordController::class, 'store'])
// ->middleware('auth');
->middleware('guest')
->name('password.update');

Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
->middleware('auth')
->name('logout');
->middleware('auth')
->name('logout');
7 changes: 0 additions & 7 deletions routes/channels.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

use App\Broadcasting\GameChannel;
use App\Broadcasting\SearchGameChannel;
use App\Models\Game;
use App\Models\User;
use App\Services\GameVerifyService;
use Illuminate\Support\Facades\Broadcast;

/*
Expand All @@ -18,10 +15,6 @@
|
*/

Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return (int)$user->id === (int)$id;
});

Broadcast::channel('search-game-{id}', SearchGameChannel::class);

Broadcast::channel('game-{token}', GameChannel::class);
9 changes: 1 addition & 8 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@
|
*/

/*
* Route for test, need only while develop
* */
Route::get('/websocket', function (IWebsocketManager $manager) {
dd($manager->getAllPresenceChannels());
});

Route::post('/subscribed/{channel}', [SubscribedOnChannelController::class, 'subscribed'])
->middleware('auth');

Route::post('/get-time', function() {
Route::post('/get-time', function () {
return response()->json(['time' => date('U')]);
});

Expand Down

0 comments on commit 68d5034

Please sign in to comment.