Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Events/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Events;

use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Queue\SerializesModels;

class Event
{
Expand Down
1 change: 0 additions & 1 deletion app/Events/UserEmailChanged.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\User;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/MailAddressesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Role;
use App\User;
use App\Http\Controllers\Controller;

class MailAddressesController extends Controller
{
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Api/MailAttachmentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers\Api;

use Storage;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Storage;

class MailAttachmentsController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/MailGroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Role;
use App\User;
use Illuminate\Support\Collection;
use App\Http\Controllers\Controller;

class MailGroupController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/PluginsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Controllers\Api;

use Gerpo\Plugisto\Models\Plugisto;
use App\Http\Controllers\Controller;
use Gerpo\Plugisto\Models\Plugisto;
use Gerpo\Plugisto\Scopes\ActiveScope;

class PluginsController extends Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Controllers\Api;

use App\User;
use App\Http\Controllers\Controller;
use App\User;

class RegisterConfirmationController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/RoleAbilitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Controllers\Api;

use App\Role;
use App\Http\Controllers\Controller;
use App\Role;

class RoleAbilitiesController extends Controller
{
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/RolesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers\Api;

use Bouncer;
use App\Http\Controllers\Controller;
use App\Role;
use Bouncer;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class RolesController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/UserEmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class UserEmailController extends Controller
public function update(User $user)
{
$data = request()->validate([
'new-email' => 'required|string|email|max:255|unique:users,email'
'new-email' => 'required|string|email|max:255|unique:users,email',
]);

$user->email = $data['new-email'];
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/UserPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class UserPasswordController extends Controller
{
public function update(User $user): void
{
$data= request()->validate([
'new-password' => 'required|string|min:6|confirmed'
$data = request()->validate([
'new-password' => 'required|string|min:6|confirmed',
]);

$user->password = Hash::make($data['new-password']);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/UserRolesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Controllers\Api;

use App\User;
use App\Http\Controllers\Controller;
use App\User;

class UserRolesController extends Controller
{
Expand Down
5 changes: 2 additions & 3 deletions app/Http/Controllers/Api/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace App\Http\Controllers\Api;

use App\Scopes\ActiveScope;
use App\User;
use App\Http\Controllers\Controller;
use App\User;

class UsersController extends Controller
{
Expand All @@ -20,7 +19,7 @@ public function index()
$query = $this->buildResidentFilterQuery($residentFilter);

$users = $query->whereNotIn('house', $dorms)
->where(function ($subQuery) use ($filter, $orderColumn, $order) {
->where(function ($subQuery) use ($filter) {
$subQuery->where('email', 'LIKE', $filter)
->orWhere('firstname', 'LIKE', $filter)
->orWhere('lastname', 'LIKE', $filter)
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

namespace App\Http\Controllers\Auth;

use Illuminate\Auth\Events\Registered;
use Illuminate\Support\Str;
use Mail;
use App\Http\Controllers\Controller;
use App\Mail\ConfirmEmailMail;
use App\User;
use Illuminate\Auth\Events\Registered;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Http\Request;
use App\Mail\ConfirmEmailMail;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Str;
use Mail;

class RegisterController extends Controller
{
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct()
public function index()
{
$packages = Auth::user()->packages();
$notifications = Notification::where('published_at','!=' , null)->get();
$notifications = Notification::where('published_at', '!=', null)->get();

return view('home', compact('packages', 'notifications'));
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/MailsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace App\Http\Controllers;

use Mail;
use App\Jobs\SendGroupMail;
use App\Mail\RegularMail;
use App\Role;
use App\User;
use App\Mail\RegularMail;
use App\Jobs\SendGroupMail;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Mail;

class MailsController extends Controller
{
Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/NotificationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class NotificationsController extends Controller
public function index()
{
$notifications = Notification::with('creator')->get();

return view('notifications')->with(compact('notifications'));
}

Expand All @@ -21,7 +22,7 @@ public function store(Request $request)
$data = $request->validate([
'title' => 'string|nullable',
'message' => 'required|string',
'is_active' => 'boolean'
'is_active' => 'boolean',
]);
$notification = Notification::make($data);
$request->user()->notifications()->save($notification);
Expand All @@ -47,10 +48,11 @@ private function sendMailToAll($subject, $message): void
public function update(Notification $notification)
{
$data = request()->validate([
'is_active' => 'required|boolean'
'is_active' => 'required|boolean',
]);

$notification->publish($data['is_active']);

return $notification->fresh();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/RolePosterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Controllers;

use PDF;
use App\Role;
use PDF;

class RolePosterController extends Controller
{
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function index()
public function show(User $user)
{
$user->load(['roles'])->append('permissions');

return view('profile')->with(['user' => $user]);
}
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/HideInactivePlugistoRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function handle($request, Closure $next)
$baseUri = explode('/', $request->path())[0];
if (Plugisto::withoutGlobalScope(ActiveScope::class)->where([
'route' => "/{$baseUri}",
'is_active' => false
'is_active' => false,
])->get()->isNotEmpty()) {
abort(404);
}
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Middleware/RedirectIfConfirmed.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace App\Http\Middleware;


use Auth;
use Closure;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/RedirectIfUnconfirmed.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RedirectIfUnconfirmed
*/
public function handle($request, Closure $next)
{
if (!Auth::user()->confirmed) {
if (! Auth::user()->confirmed) {
return redirect('/verify');
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Middleware;

use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;

class TrustProxies extends Middleware
{
Expand Down
6 changes: 3 additions & 3 deletions app/Jobs/SendGroupMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace App\Jobs;

use Mail;
use App\Mail\RegularMail;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Mail;

class SendGroupMail implements ShouldQueue
{
Expand Down
2 changes: 0 additions & 2 deletions app/Listeners/SendEmailConfirmationEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use App\Events\UserEmailChanged;
use App\Mail\ConfirmEmailMail;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Mail;

class SendEmailConfirmationEmail
Expand Down
2 changes: 1 addition & 1 deletion app/Mail/ConfirmEmailMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class ConfirmEmailMail extends Mailable implements ShouldQueue
{
Expand Down
2 changes: 1 addition & 1 deletion app/Mail/NotificationMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class NotificationMail extends Mailable implements ShouldQueue
{
Expand Down
4 changes: 2 additions & 2 deletions app/Mail/RegularMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Mail;

use Storage;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Storage;

class RegularMail extends Mailable implements ShouldQueue
{
Expand Down
5 changes: 2 additions & 3 deletions app/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Parsedown;

class Notification extends Model
{
Expand All @@ -17,15 +16,15 @@ class Notification extends Model
];

protected $casts = [
'is_active' => 'boolean'
'is_active' => 'boolean',
];

public static function boot()
{
parent::boot();

static::saving(function ($notification) {
if (!$notification->is_active || $notification->published_at !== null) {
if (! $notification->is_active || $notification->published_at !== null) {
return;
}

Expand Down
Loading