mirror of
				https://github.com/brunofontes/shareit.git
				synced 2025-11-04 03:31:02 -03:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "5c143450e700bb6f521d7d9fd6a230346e17e442" and "f89e0639dc872408791ca524e5a2518587f77e04" have entirely different histories.
		
	
	
		
			5c143450e7
			...
			f89e0639dc
		
	
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -9,4 +9,3 @@ npm-debug.log
 | 
			
		||||
yarn-error.log
 | 
			
		||||
.env
 | 
			
		||||
.phpunit.result.cache
 | 
			
		||||
tags
 | 
			
		||||
 | 
			
		||||
@ -3,10 +3,13 @@
 | 
			
		||||
namespace App\Events;
 | 
			
		||||
 | 
			
		||||
use \App\Item;
 | 
			
		||||
use Illuminate\Broadcasting\InteractsWithSockets;
 | 
			
		||||
use Illuminate\Broadcasting\PrivateChannel;
 | 
			
		||||
use Illuminate\Foundation\Events\Dispatchable;
 | 
			
		||||
use Illuminate\Broadcasting\Channel;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Illuminate\Broadcasting\PrivateChannel;
 | 
			
		||||
use Illuminate\Broadcasting\PresenceChannel;
 | 
			
		||||
use Illuminate\Foundation\Events\Dispatchable;
 | 
			
		||||
use Illuminate\Broadcasting\InteractsWithSockets;
 | 
			
		||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 | 
			
		||||
 | 
			
		||||
class ReturnItem
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,8 @@
 | 
			
		||||
namespace App\Exceptions;
 | 
			
		||||
 | 
			
		||||
use Exception;
 | 
			
		||||
Use Throwable;
 | 
			
		||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 | 
			
		||||
use Throwable;
 | 
			
		||||
 | 
			
		||||
class Handler extends ExceptionHandler
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -2,12 +2,12 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use \App\Mail\UserWaiting;
 | 
			
		||||
use Auth;
 | 
			
		||||
use Mail;
 | 
			
		||||
use \App\User;
 | 
			
		||||
use App\FlashMessage;
 | 
			
		||||
use Auth;
 | 
			
		||||
use \App\Mail\UserWaiting;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Mail;
 | 
			
		||||
 | 
			
		||||
class AlertController extends Controller
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Http\Controllers\Auth;
 | 
			
		||||
 | 
			
		||||
use App\FlashMessage;
 | 
			
		||||
use App\Http\Controllers\Controller;
 | 
			
		||||
use App\Mail\Welcome;
 | 
			
		||||
use App\User;
 | 
			
		||||
use Illuminate\Foundation\Auth\RegistersUsers;
 | 
			
		||||
use App\Mail\Welcome;
 | 
			
		||||
use App\Http\Controllers\Controller;
 | 
			
		||||
use Illuminate\Support\Facades\Hash;
 | 
			
		||||
use Illuminate\Support\Facades\Validator;
 | 
			
		||||
use Illuminate\Foundation\Auth\RegistersUsers;
 | 
			
		||||
use App\FlashMessage;
 | 
			
		||||
use Mail;
 | 
			
		||||
 | 
			
		||||
class RegisterController extends Controller
 | 
			
		||||
 | 
			
		||||
@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
 | 
			
		||||
use Illuminate\Foundation\Bus\DispatchesJobs;
 | 
			
		||||
use Illuminate\Foundation\Validation\ValidatesRequests;
 | 
			
		||||
use Illuminate\Routing\Controller as BaseController;
 | 
			
		||||
use Illuminate\Foundation\Validation\ValidatesRequests;
 | 
			
		||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
 | 
			
		||||
 | 
			
		||||
class Controller extends BaseController
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -4,8 +4,8 @@ namespace App\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use \App\Item;
 | 
			
		||||
use \App\User;
 | 
			
		||||
use App\FlashMessage as flash;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use App\FlashMessage as flash;
 | 
			
		||||
 | 
			
		||||
class ItemController extends Controller
 | 
			
		||||
{
 | 
			
		||||
@ -13,8 +13,7 @@ class ItemController extends Controller
 | 
			
		||||
    {
 | 
			
		||||
        $item = Item::find($id);
 | 
			
		||||
        if (!$item || $item->product->user_id != \Auth::id()) {
 | 
			
		||||
            session()->flash(
 | 
			
		||||
                flash::DANGER,
 | 
			
		||||
            session()->flash(flash::DANGER, 
 | 
			
		||||
                \Lang::getFromJson(
 | 
			
		||||
                    "The item doesn't exist."
 | 
			
		||||
                )
 | 
			
		||||
 | 
			
		||||
@ -3,6 +3,7 @@
 | 
			
		||||
namespace App\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use App;
 | 
			
		||||
use Lang;
 | 
			
		||||
use App\User;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -3,10 +3,10 @@
 | 
			
		||||
namespace App\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use \App\Item;
 | 
			
		||||
use \App\Product;
 | 
			
		||||
use \App\User;
 | 
			
		||||
use App\FlashMessage as flash;
 | 
			
		||||
use \App\Product;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use App\FlashMessage as flash;
 | 
			
		||||
 | 
			
		||||
class ProductController extends Controller
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -2,11 +2,13 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use App\Events\ReturnItem;
 | 
			
		||||
use Auth;
 | 
			
		||||
use Lang;
 | 
			
		||||
use App\Item;
 | 
			
		||||
use App\User;
 | 
			
		||||
use App\Events\ReturnItem;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Lang;
 | 
			
		||||
use PhpParser\Node\Stmt\TryCatch;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Responsible to Take and Return an Item.
 | 
			
		||||
@ -49,6 +51,7 @@ class TakeController extends Controller
 | 
			
		||||
 | 
			
		||||
        try {
 | 
			
		||||
            $item->returnItem();
 | 
			
		||||
 | 
			
		||||
        } catch (\Exception $e) {
 | 
			
		||||
            return back()->withErrors(
 | 
			
		||||
                Lang::getFromJson("You cannot return an item that is not with you")
 | 
			
		||||
 | 
			
		||||
@ -2,9 +2,10 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use \App\Item;
 | 
			
		||||
use \App\User;
 | 
			
		||||
use \Lang;
 | 
			
		||||
use \App\User;
 | 
			
		||||
use \App\Item;
 | 
			
		||||
use \App\Product;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
 | 
			
		||||
class UserController extends Controller
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Http\Middleware;
 | 
			
		||||
 | 
			
		||||
use Fideloper\Proxy\TrustProxies as Middleware;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Fideloper\Proxy\TrustProxies as Middleware;
 | 
			
		||||
 | 
			
		||||
class TrustProxies extends Middleware
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,9 @@
 | 
			
		||||
namespace App;
 | 
			
		||||
 | 
			
		||||
use Auth;
 | 
			
		||||
use Exception;
 | 
			
		||||
use Lang;
 | 
			
		||||
use Illuminate\Database\Eloquent\Model;
 | 
			
		||||
use Exception;
 | 
			
		||||
 | 
			
		||||
class Item extends Model
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -2,10 +2,12 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Listeners;
 | 
			
		||||
 | 
			
		||||
use Mail;
 | 
			
		||||
use App\User;
 | 
			
		||||
use App\Events\ReturnItem;
 | 
			
		||||
use App\Mail\ItemAvailable;
 | 
			
		||||
use App\User;
 | 
			
		||||
use Mail;
 | 
			
		||||
use Illuminate\Queue\InteractsWithQueue;
 | 
			
		||||
use Illuminate\Contracts\Queue\ShouldQueue;
 | 
			
		||||
 | 
			
		||||
class AlertReturnedItem
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,10 @@
 | 
			
		||||
namespace App\Listeners;
 | 
			
		||||
 | 
			
		||||
use App\User;
 | 
			
		||||
use Illuminate\Auth\Events\Login;
 | 
			
		||||
use IlluminateAuthEventsLogin;
 | 
			
		||||
use Illuminate\Queue\InteractsWithQueue;
 | 
			
		||||
use Illuminate\Contracts\Queue\ShouldQueue;
 | 
			
		||||
use Illuminate\Auth\Events\Login;
 | 
			
		||||
 | 
			
		||||
class SetLanguage
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@ use \App\Item;
 | 
			
		||||
use Illuminate\Bus\Queueable;
 | 
			
		||||
use Illuminate\Mail\Mailable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Illuminate\Contracts\Queue\ShouldQueue;
 | 
			
		||||
 | 
			
		||||
class ItemAvailable extends Mailable
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -2,11 +2,12 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Mail;
 | 
			
		||||
 | 
			
		||||
use Lang;
 | 
			
		||||
use \App\Item;
 | 
			
		||||
use Illuminate\Bus\Queueable;
 | 
			
		||||
use Illuminate\Mail\Mailable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Lang;
 | 
			
		||||
use Illuminate\Contracts\Queue\ShouldQueue;
 | 
			
		||||
 | 
			
		||||
class UserWaiting extends Mailable
 | 
			
		||||
{
 | 
			
		||||
@ -35,7 +36,7 @@ class UserWaiting extends Mailable
 | 
			
		||||
    public function build()
 | 
			
		||||
    {
 | 
			
		||||
        return $this->subject(
 | 
			
		||||
            Lang::get(
 | 
			
		||||
            Lang::getFromJson(
 | 
			
		||||
                ':waitinguser wants to use :itemname', 
 | 
			
		||||
                [
 | 
			
		||||
                    'waitinguser' => $this->waitingUser, 
 | 
			
		||||
 | 
			
		||||
@ -2,11 +2,12 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Mail;
 | 
			
		||||
 | 
			
		||||
use \App\User;
 | 
			
		||||
use \Lang;
 | 
			
		||||
use \App\User;
 | 
			
		||||
use Illuminate\Bus\Queueable;
 | 
			
		||||
use Illuminate\Mail\Mailable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Illuminate\Contracts\Queue\ShouldQueue;
 | 
			
		||||
 | 
			
		||||
class Welcome extends Mailable
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Illuminate\Support\ServiceProvider;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
 | 
			
		||||
class AppServiceProvider extends ServiceProvider
 | 
			
		||||
{
 | 
			
		||||
@ -14,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
 | 
			
		||||
     */
 | 
			
		||||
    public function boot()
 | 
			
		||||
    {
 | 
			
		||||
        Schema::defaultStringLength(191); //Solved by increasing StringLength
 | 
			
		||||
	Schema::defaultStringLength(191); //Solved by increasing StringLength
 | 
			
		||||
        //
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,7 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Facades\Gate;
 | 
			
		||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
 | 
			
		||||
 | 
			
		||||
class AuthServiceProvider extends ServiceProvider
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Facades\Broadcast;
 | 
			
		||||
use Illuminate\Support\ServiceProvider;
 | 
			
		||||
use Illuminate\Support\Facades\Broadcast;
 | 
			
		||||
 | 
			
		||||
class BroadcastServiceProvider extends ServiceProvider
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -3,12 +3,12 @@
 | 
			
		||||
namespace App\Providers;
 | 
			
		||||
 | 
			
		||||
use App\Events\ReturnItem;
 | 
			
		||||
use App\Listeners\AlertReturnedItem;
 | 
			
		||||
use App\Listeners\SetLanguage;
 | 
			
		||||
use App\Listeners\AlertReturnedItem;
 | 
			
		||||
use Illuminate\Support\Facades\Event;
 | 
			
		||||
use Illuminate\Auth\Events\Registered;
 | 
			
		||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
 | 
			
		||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
 | 
			
		||||
use Illuminate\Support\Facades\Event;
 | 
			
		||||
 | 
			
		||||
class EventServiceProvider extends ServiceProvider
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@
 | 
			
		||||
 | 
			
		||||
namespace App\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
 | 
			
		||||
use Illuminate\Support\Facades\Route;
 | 
			
		||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
 | 
			
		||||
 | 
			
		||||
class RouteServiceProvider extends ServiceProvider
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -3,9 +3,10 @@
 | 
			
		||||
namespace App;
 | 
			
		||||
 | 
			
		||||
use Auth;
 | 
			
		||||
use Illuminate\Notifications\Notifiable;
 | 
			
		||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
 | 
			
		||||
use Illuminate\Foundation\Auth\User as Authenticatable;
 | 
			
		||||
use Illuminate\Notifications\Notifiable;
 | 
			
		||||
use Illuminate\Support\Facades\Request;
 | 
			
		||||
 | 
			
		||||
class User extends Authenticatable implements MustVerifyEmail
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										457
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										457
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,8 +1,8 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
 | 
			
		||||
class CreateUsersTable extends Migration
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
 | 
			
		||||
class CreatePasswordResetsTable extends Migration
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
 | 
			
		||||
class CreateProductsTable extends Migration
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
 | 
			
		||||
class CreateItemsTable extends Migration
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
 | 
			
		||||
class AddLocationToUsers extends Migration
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										19969
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										19969
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -3,8 +3,8 @@
 | 
			
		||||
namespace Tests\Feature;
 | 
			
		||||
 | 
			
		||||
use \App\Product;
 | 
			
		||||
use Illuminate\Foundation\Testing\RefreshDatabase;
 | 
			
		||||
use Tests\TestCase;
 | 
			
		||||
use Illuminate\Foundation\Testing\RefreshDatabase;
 | 
			
		||||
 | 
			
		||||
class ExampleTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -3,6 +3,7 @@
 | 
			
		||||
namespace Tests\Unit;
 | 
			
		||||
 | 
			
		||||
use Tests\TestCase;
 | 
			
		||||
use Illuminate\Foundation\Testing\RefreshDatabase;
 | 
			
		||||
 | 
			
		||||
class ExampleTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user