Skip to content
Merged
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
35 changes: 16 additions & 19 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
php:
risky: false
version: 7.4
preset: recommended
tab-width: 4
use-tabs: true
finder:
exclude:
- "modules"
- "node_modules"
- "nova"
- "nova-components"
- "storage"
- "spark"
- "vendor"
name: "*.php"
not-name:
- "*.blade.php"
- "_ide_helper.php"
risky: false
version: 7.4
preset: recommended
finder:
exclude:
- "modules"
- "node_modules"
- "nova"
- "nova-components"
- "storage"
- "spark"
- "vendor"
name: "*.php"
not-name:
- "*.blade.php"
- "_ide_helper.php"
2 changes: 1 addition & 1 deletion app/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App;

use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;

class Channel extends Model
{
Expand Down
3 changes: 2 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @return void
*/
protected function schedule(Schedule $schedule)
Expand Down
8 changes: 5 additions & 3 deletions app/Events/ThreadReceivedNewReply.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

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 ThreadReceivedNewReply
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

public $reply;

Expand Down
8 changes: 5 additions & 3 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* @param \Exception $exception
* @param \Exception $exception
*
* @return void
*/
public function report(Exception $exception)
Expand All @@ -40,8 +41,9 @@ public function report(Exception $exception)
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
Expand Down
5 changes: 3 additions & 2 deletions app/Extensions/EloquentUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

namespace App\Extensions;

use Illuminate\Support\Str;
use Illuminate\Auth\EloquentUserProvider as BaseUserProvider;
use Illuminate\Support\Str;

class EloquentUserProvider extends BaseUserProvider
{
/**
* Retrieve a user by the given credentials.
*
* @param array $credentials
* @param array $credentials
*
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object
*/
public function retrieveByCredentials(array $credentials)
Expand Down
6 changes: 2 additions & 4 deletions app/Favoritable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App;

use Illuminate\Database\Eloquent\Model;

trait Favoritable
{
protected static function bootFavoritable()
Expand All @@ -22,7 +20,7 @@ public function favorite()
{
$arrtributes = ['user_id' => auth()->id()];

if (! $this->favorites()->where($arrtributes)->exists()){
if (!$this->favorites()->where($arrtributes)->exists()) {
return $this->favorites()->create($arrtributes);
}
}
Expand All @@ -36,7 +34,7 @@ public function unfavorite()

public function isFavorited()
{
return ! ! $this->favorites->where('user_id', auth()->id())->count();
return (bool) $this->favorites->where('user_id', auth()->id())->count();
}

public function getIsFavoritedAttribute()
Expand Down
3 changes: 2 additions & 1 deletion app/Filters/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

abstract class Filters
{
protected $request, $builder;
protected $request;
protected $builder;

protected $filters = [];

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/ChannelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function store()
{
$channel = Channel::create(
request()->validate([
'name' => 'required|unique:channels',
'name' => 'required|unique:channels',
'description' => 'required',
])
);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/ThreadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Thread;
use App\Trending;
use App\Http\Controllers\Controller;

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

namespace App\Http\Controllers\Auth;

use App\User;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
Expand Down Expand Up @@ -47,29 +47,31 @@ protected function redirectTo()
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @param array $data
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255', 'unique:users'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'name' => ['required', 'string', 'max:255', 'unique:users'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}

/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @param array $data
*
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
Expand Down
8 changes: 5 additions & 3 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

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
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}
10 changes: 5 additions & 5 deletions app/Http/Controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Controllers;

use App\User;
use App\Activity;
use App\User;
use Illuminate\Http\Request;

class ProfileController extends Controller
Expand All @@ -17,7 +17,7 @@ public function show(User $user)
{
return view('profiles.show', [
'profileUser' => $user,
'activities' => Activity::feed($user)
'activities' => Activity::feed($user),
]);
}

Expand All @@ -36,12 +36,12 @@ public function read($user, $notificationId)
public function avatar(Request $request, User $user)
{
request()->validate([
'avatar' => ['required', 'image']
'avatar' => ['required', 'image'],
]);

if ($request->file('avatar')) {
$path = $request->file('avatar')->storePublicly('avatars/' . $user->name, 'public');
$user->avatar = "/storage/" . $path;
$path = $request->file('avatar')->storePublicly('avatars/'.$user->name, 'public');
$user->avatar = '/storage/'.$path;

$user->save();
}
Expand Down
14 changes: 7 additions & 7 deletions app/Http/Controllers/ReplyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers;

use App\Reply;
use App\Thread;
use App\Channel;
use App\Reply;
use App\Rules\Recaptcha;
use App\Thread;

class ReplyController extends Controller
{
Expand All @@ -16,15 +16,15 @@ public function __construct()

public function store(Channel $channel, Thread $thread, Recaptcha $recaptcha)
{
$this->validate(request(),[
'body' => 'required|min:3',
$this->validate(request(), [
'body' => 'required|min:3',
'g-recaptcha-response' => $recaptcha,
]);

if ($thread->locked == false) {
$reply = $thread->addReply([
'body' => request('body'),
'user_id' => auth()->id()
'body' => request('body'),
'user_id' => auth()->id(),
]);

if (request()->expectsJson()) {
Expand All @@ -45,7 +45,7 @@ public function update(Reply $reply, Thread $thread, Recaptcha $recaptcha)
$this->authorize('update', $reply);

$this->validate(request(), [
'body' => 'required|min:3',
'body' => 'required|min:3',
'g-recaptcha-response' => $recaptcha,
]);

Expand Down
Loading