├── .env.example
├── .gitattributes
├── .gitignore
├── Procfile
├── app
├── Category.php
├── Comment.php
├── Console
│ ├── Commands
│ │ └── Inspire.php
│ └── Kernel.php
├── Events
│ └── Event.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── Auth
│ │ │ ├── AuthController.php
│ │ │ └── PasswordController.php
│ │ ├── CommentsController.php
│ │ ├── Controller.php
│ │ ├── HomeController.php
│ │ └── TicketsController.php
│ ├── Kernel.php
│ ├── Middleware
│ │ ├── AdminMiddleware.php
│ │ ├── Authenticate.php
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ └── VerifyCsrfToken.php
│ ├── Requests
│ │ └── Request.php
│ └── routes.php
├── Jobs
│ └── Job.php
├── Listeners
│ └── .gitkeep
├── Mailers
│ └── AppMailer.php
├── Policies
│ └── .gitkeep
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Ticket.php
└── User.php
├── artisan
├── bootstrap
├── app.php
├── autoload.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── compile.php
├── database.php
├── filesystems.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── ModelFactory.php
├── migrations
│ ├── .gitkeep
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2016_06_25_091542_create_tickets_table.php
│ ├── 2016_06_25_102115_create_categories_table.php
│ └── 2016_07_02_160300_create_comments_table.php
└── seeds
│ ├── .gitkeep
│ └── DatabaseSeeder.php
├── gulpfile.js
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── favicon.ico
├── index.php
├── robots.txt
└── web.config
├── readme.md
├── resources
├── assets
│ └── sass
│ │ └── app.scss
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
└── views
│ ├── auth
│ ├── emails
│ │ └── password.blade.php
│ ├── login.blade.php
│ ├── passwords
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ └── register.blade.php
│ ├── emails
│ ├── ticket_comments.blade.php
│ ├── ticket_info.blade.php
│ └── ticket_status.blade.php
│ ├── errors
│ ├── 503.blade.php
│ └── _404.blade.php
│ ├── home.blade.php
│ ├── includes
│ └── flash.blade.php
│ ├── layouts
│ └── app.blade.php
│ ├── tickets
│ ├── create.blade.php
│ ├── index.blade.php
│ ├── show.blade.php
│ └── user_tickets.blade.php
│ └── vendor
│ └── .gitkeep
├── server.php
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
└── tests
├── ExampleTest.php
└── TestCase.php
/.env.example:
--------------------------------------------------------------------------------
1 | APP_ENV=local
2 | APP_KEY=SomeRandomString
3 | APP_DEBUG=true
4 | APP_LOG_LEVEL=debug
5 | APP_URL=http://localhost
6 |
7 | DB_CONNECTION=mysql
8 | DB_HOST=127.0.0.1
9 | DB_PORT=3306
10 | DB_DATABASE=homestead
11 | DB_USERNAME=homestead
12 | DB_PASSWORD=secret
13 |
14 | CACHE_DRIVER=file
15 | SESSION_DRIVER=file
16 | QUEUE_DRIVER=sync
17 |
18 | REDIS_HOST=127.0.0.1
19 | REDIS_PASSWORD=null
20 | REDIS_PORT=6379
21 |
22 | MAIL_DRIVER=smtp
23 | MAIL_HOST=mailtrap.io
24 | MAIL_PORT=2525
25 | MAIL_USERNAME=null
26 | MAIL_PASSWORD=null
27 | MAIL_ENCRYPTION=null
28 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | /node_modules
3 | /public/storage
4 | Homestead.yaml
5 | Homestead.json
6 | .env
7 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: vendor/bin/heroku-php-apache2 public/
2 |
--------------------------------------------------------------------------------
/app/Category.php:
--------------------------------------------------------------------------------
1 | hasMany(Ticket::class);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Comment.php:
--------------------------------------------------------------------------------
1 | belongsTo(Ticket::class);
24 | }
25 |
26 | /**
27 | * A comment belongs to a user
28 | */
29 | public function user()
30 | {
31 | return $this->belongsTo(User::class);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Console/Commands/Inspire.php:
--------------------------------------------------------------------------------
1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Events/Event.php:
--------------------------------------------------------------------------------
1 | middleware($this->guestMiddleware(), ['except' => 'logout']);
41 | }
42 |
43 | /**
44 | * Get a validator for an incoming registration request.
45 | *
46 | * @param array $data
47 | * @return \Illuminate\Contracts\Validation\Validator
48 | */
49 | protected function validator(array $data)
50 | {
51 | return Validator::make($data, [
52 | 'name' => 'required|max:255',
53 | 'email' => 'required|email|max:255|unique:users',
54 | 'password' => 'required|min:6|confirmed',
55 | ]);
56 | }
57 |
58 | /**
59 | * Create a new user instance after a valid registration.
60 | *
61 | * @param array $data
62 | * @return User
63 | */
64 | protected function create(array $data)
65 | {
66 | return User::create([
67 | 'name' => $data['name'],
68 | 'email' => $data['email'],
69 | 'password' => bcrypt($data['password']),
70 | ]);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/PasswordController.php:
--------------------------------------------------------------------------------
1 | middleware($this->guestMiddleware());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Controllers/CommentsController.php:
--------------------------------------------------------------------------------
1 | validate($request, [
24 | 'comment' => 'required'
25 | ]);
26 |
27 | $comment = Comment::create([
28 | 'ticket_id' => $request->input('ticket_id'),
29 | 'user_id' => Auth::user()->id,
30 | 'comment' => $request->input('comment'),
31 | ]);
32 |
33 | // send mail if the user commenting is not the ticket owner
34 | if ($comment->ticket->user->id !== Auth::user()->id) {
35 | $mailer->sendTicketComments($comment->ticket->user, Auth::user(), $comment->ticket, $comment);
36 | }
37 |
38 | return redirect()->back()->with("status", "Your comment has be submitted.");
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
18 | }
19 |
20 | /**
21 | * Show the application dashboard.
22 | *
23 | * @return \Illuminate\Http\Response
24 | */
25 | public function index()
26 | {
27 | return view('home');
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/Http/Controllers/TicketsController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
18 | }
19 |
20 | /**
21 | * Display all tickets.
22 | *
23 | * @return \Illuminate\Http\Response
24 | */
25 | public function index()
26 | {
27 | $tickets = Ticket::paginate(10);
28 | $categories = Category::all();
29 |
30 | return view('tickets.index', compact('tickets', 'categories'));
31 | }
32 |
33 | /**
34 | * Display all tickets by a user.
35 | *
36 | * @return \Illuminate\Http\Response
37 | */
38 | public function userTickets()
39 | {
40 | $tickets = Ticket::where('user_id', Auth::user()->id)->paginate(10);
41 | $categories = Category::all();
42 |
43 | return view('tickets.user_tickets', compact('tickets', 'categories'));
44 | }
45 |
46 | /**
47 | * Show the form for opening a new ticket.
48 | *
49 | * @return \Illuminate\Http\Response
50 | */
51 | public function create()
52 | {
53 | $categories = Category::all();
54 |
55 | return view('tickets.create', compact('categories'));
56 | }
57 |
58 | /**
59 | * Store a newly created ticket in database.
60 | *
61 | * @param \Illuminate\Http\Request $request
62 | * @return \Illuminate\Http\Response
63 | */
64 | public function store(Request $request, AppMailer $mailer)
65 | {
66 | $this->validate($request, [
67 | 'title' => 'required',
68 | 'category' => 'required',
69 | 'priority' => 'required',
70 | 'message' => 'required'
71 | ]);
72 |
73 | $ticket = new Ticket([
74 | 'title' => $request->input('title'),
75 | 'user_id' => Auth::user()->id,
76 | 'ticket_id' => strtoupper(str_random(10)),
77 | 'category_id' => $request->input('category'),
78 | 'priority' => $request->input('priority'),
79 | 'message' => $request->input('message'),
80 | 'status' => "Open",
81 | ]);
82 |
83 | $ticket->save();
84 |
85 | $mailer->sendTicketInformation(Auth::user(), $ticket);
86 |
87 | return redirect()->back()->with("status", "A ticket with ID: #$ticket->ticket_id has been opened.");
88 | }
89 |
90 | /**
91 | * Display a specified ticket.
92 | *
93 | * @param int $ticket_id
94 | * @return \Illuminate\Http\Response
95 | */
96 | public function show($ticket_id)
97 | {
98 | $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
99 |
100 | $comments = $ticket->comments;
101 |
102 | $category = $ticket->category;
103 |
104 | return view('tickets.show', compact('ticket', 'category', 'comments'));
105 | }
106 |
107 | /**
108 | * Close the specified ticket.
109 | *
110 | * @param int $id
111 | * @return \Illuminate\Http\Response
112 | */
113 | public function close($ticket_id, AppMailer $mailer)
114 | {
115 | $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
116 |
117 | $ticket->status = 'Closed';
118 |
119 | $ticket->save();
120 |
121 | $ticketOwner = $ticket->user;
122 |
123 | $mailer->sendTicketStatusNotification($ticketOwner, $ticket);
124 |
125 | return redirect()->back()->with("status", "The ticket has been closed.");
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
27 | \App\Http\Middleware\EncryptCookies::class,
28 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
29 | \Illuminate\Session\Middleware\StartSession::class,
30 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
31 | \App\Http\Middleware\VerifyCsrfToken::class,
32 | ],
33 |
34 | 'api' => [
35 | 'throttle:60,1',
36 | ],
37 | ];
38 |
39 | /**
40 | * The application's route middleware.
41 | *
42 | * These middleware may be assigned to groups or used individually.
43 | *
44 | * @var array
45 | */
46 | protected $routeMiddleware = [
47 | 'auth' => \App\Http\Middleware\Authenticate::class,
48 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
49 | 'can' => \Illuminate\Foundation\Http\Middleware\Authorize::class,
50 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
51 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
52 | 'admin' => \App\Http\Middleware\AdminMiddleware::class,
53 | ];
54 | }
55 |
--------------------------------------------------------------------------------
/app/Http/Middleware/AdminMiddleware.php:
--------------------------------------------------------------------------------
1 | is_admin !== 1) {
20 | return redirect('home');
21 | }
22 |
23 | return $next($request);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | guest()) {
21 | if ($request->ajax() || $request->wantsJson()) {
22 | return response('Unauthorized.', 401);
23 | } else {
24 | return redirect()->guest('login');
25 | }
26 | }
27 |
28 | return $next($request);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | 'admin', 'middleware' => ['auth', 'admin']], function() {
25 | Route::get('tickets', 'TicketsController@index');
26 | Route::post('close_ticket/{ticket_id}', 'TicketsController@close');
27 | });
28 |
29 | Route::post('comment', 'CommentsController@postComment');
30 |
--------------------------------------------------------------------------------
/app/Jobs/Job.php:
--------------------------------------------------------------------------------
1 | mailer = $mailer;
50 | }
51 |
52 | /**
53 | * Send Ticket information to user
54 | *
55 | * @param User $user
56 | * @param Ticket $ticket
57 | * @return method deliver()
58 | */
59 | public function sendTicketInformation($user, Ticket $ticket)
60 | {
61 | $this->to = $user->email;
62 | $this->subject = "[Ticket ID: $ticket->ticket_id] $ticket->title";
63 | $this->view = 'emails.ticket_info';
64 | $this->data = compact('user', 'ticket');
65 |
66 | return $this->deliver();
67 | }
68 |
69 | /**
70 | * Send Ticket Comments/Replies to Ticket Owner
71 | *
72 | * @param User $ticketOwner
73 | * @param User $user
74 | * @param Ticket $ticket
75 | * @param Comment $comment
76 | * @return method deliver()
77 | */
78 | public function sendTicketComments($ticketOwner, $user, Ticket $ticket, $comment)
79 | {
80 | $this->to = $ticketOwner->email;
81 | $this->subject = "RE: $ticket->title (Ticket ID: $ticket->ticket_id)";
82 | $this->view = 'emails.ticket_comments';
83 | $this->data = compact('ticketOwner', 'user', 'ticket', 'comment');
84 |
85 | return $this->deliver();
86 | }
87 |
88 | /**
89 | * Send ticket status notification
90 | *
91 | * @param User $ticketOwner
92 | * @param Ticket $ticket
93 | * @return method deliver()
94 | */
95 | public function sendTicketStatusNotification($ticketOwner, Ticket $ticket)
96 | {
97 | $this->to = $ticketOwner->email;
98 | $this->subject = "RE: $ticket->title (Ticket ID: $ticket->ticket_id)";
99 | $this->view = 'emails.ticket_status';
100 | $this->data = compact('ticketOwner', 'ticket');
101 |
102 | return $this->deliver();
103 | }
104 |
105 | /**
106 | * Do the actual sending of the mail
107 | */
108 | public function deliver()
109 | {
110 | $this->mailer->send($this->view, $this->data, function($message) {
111 | $message->from($this->fromAddress, $this->fromName)
112 | ->to($this->to)->subject($this->subject);
113 | });
114 | }
115 | }
--------------------------------------------------------------------------------
/app/Policies/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any application authentication / authorization services.
21 | *
22 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate
23 | * @return void
24 | */
25 | public function boot(GateContract $gate)
26 | {
27 | $this->registerPolicies($gate);
28 |
29 | //
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
17 | 'App\Listeners\EventListener',
18 | ],
19 | ];
20 |
21 | /**
22 | * Register any other events for your application.
23 | *
24 | * @param \Illuminate\Contracts\Events\Dispatcher $events
25 | * @return void
26 | */
27 | public function boot(DispatcherContract $events)
28 | {
29 | parent::boot($events);
30 |
31 | //
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapWebRoutes($router);
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @param \Illuminate\Routing\Router $router
51 | * @return void
52 | */
53 | protected function mapWebRoutes(Router $router)
54 | {
55 | $router->group([
56 | 'namespace' => $this->namespace, 'middleware' => 'web',
57 | ], function ($router) {
58 | require app_path('Http/routes.php');
59 | });
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/Ticket.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
24 | }
25 |
26 | /**
27 | * A ticket can have many comments
28 | */
29 | public function comments()
30 | {
31 | return $this->hasMany(Comment::class);
32 | }
33 |
34 | /**
35 | * A ticket belongs to a category
36 | */
37 | public function category()
38 | {
39 | return $this->belongsTo(Category::class);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | hasMany(Ticket::class);
33 | }
34 |
35 | /**
36 | * A user can have many comments
37 | */
38 | public function comments()
39 | {
40 | return $this->hasMany(Comment::class);
41 | }
42 |
43 | /**
44 | * Get the user that created ticket
45 | * @param User $user_id
46 | */
47 | public static function getTicketOwner($user_id)
48 | {
49 | return static::where('id', $user_id)->firstOrFail();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
32 |
33 | $status = $kernel->handle(
34 | $input = new Symfony\Component\Console\Input\ArgvInput,
35 | new Symfony\Component\Console\Output\ConsoleOutput
36 | );
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Shutdown The Application
41 | |--------------------------------------------------------------------------
42 | |
43 | | Once Artisan has finished running. We will fire off the shutdown events
44 | | so that any final work may be done by the application before we shut
45 | | down the process. This is the last thing to happen to the request.
46 | |
47 | */
48 |
49 | $kernel->terminate($input, $status);
50 |
51 | exit($status);
52 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/autoload.php:
--------------------------------------------------------------------------------
1 | =5.5.9",
9 | "laravel/framework": "5.2.*"
10 | },
11 | "require-dev": {
12 | "fzaninotto/faker": "~1.4",
13 | "mockery/mockery": "0.9.*",
14 | "phpunit/phpunit": "~4.0",
15 | "symfony/css-selector": "2.8.*|3.0.*",
16 | "symfony/dom-crawler": "2.8.*|3.0.*"
17 | },
18 | "autoload": {
19 | "classmap": [
20 | "database"
21 | ],
22 | "psr-4": {
23 | "App\\": "app/"
24 | }
25 | },
26 | "autoload-dev": {
27 | "classmap": [
28 | "tests/TestCase.php"
29 | ]
30 | },
31 | "scripts": {
32 | "post-root-package-install": [
33 | "php -r \"copy('.env.example', '.env');\""
34 | ],
35 | "post-create-project-cmd": [
36 | "php artisan key:generate"
37 | ],
38 | "post-install-cmd": [
39 | "Illuminate\\Foundation\\ComposerScripts::postInstall",
40 | "php artisan optimize"
41 | ],
42 | "post-update-cmd": [
43 | "Illuminate\\Foundation\\ComposerScripts::postUpdate",
44 | "php artisan optimize"
45 | ]
46 | },
47 | "config": {
48 | "preferred-install": "dist"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_ENV', 'production'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application Debug Mode
21 | |--------------------------------------------------------------------------
22 | |
23 | | When your application is in debug mode, detailed error messages with
24 | | stack traces will be shown on every error that occurs within your
25 | | application. If disabled, a simple generic error page is shown.
26 | |
27 | */
28 |
29 | 'debug' => env('APP_DEBUG', false),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application URL
34 | |--------------------------------------------------------------------------
35 | |
36 | | This URL is used by the console to properly generate URLs when using
37 | | the Artisan command line tool. You should set this to the root of
38 | | your application so that it is used when running Artisan tasks.
39 | |
40 | */
41 |
42 | 'url' => env('APP_URL', 'http://localhost'),
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application Timezone
47 | |--------------------------------------------------------------------------
48 | |
49 | | Here you may specify the default timezone for your application, which
50 | | will be used by the PHP date and date-time functions. We have gone
51 | | ahead and set this to a sensible default for you out of the box.
52 | |
53 | */
54 |
55 | 'timezone' => 'UTC',
56 |
57 | /*
58 | |--------------------------------------------------------------------------
59 | | Application Locale Configuration
60 | |--------------------------------------------------------------------------
61 | |
62 | | The application locale determines the default locale that will be used
63 | | by the translation service provider. You are free to set this value
64 | | to any of the locales which will be supported by the application.
65 | |
66 | */
67 |
68 | 'locale' => 'en',
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Application Fallback Locale
73 | |--------------------------------------------------------------------------
74 | |
75 | | The fallback locale determines the locale to use when the current one
76 | | is not available. You may change the value to correspond to any of
77 | | the language folders that are provided through your application.
78 | |
79 | */
80 |
81 | 'fallback_locale' => 'en',
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Encryption Key
86 | |--------------------------------------------------------------------------
87 | |
88 | | This key is used by the Illuminate encrypter service and should be set
89 | | to a random, 32 character string, otherwise these encrypted strings
90 | | will not be safe. Please do this before deploying an application!
91 | |
92 | */
93 |
94 | 'key' => env('APP_KEY'),
95 |
96 | 'cipher' => 'AES-256-CBC',
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Logging Configuration
101 | |--------------------------------------------------------------------------
102 | |
103 | | Here you may configure the log settings for your application. Out of
104 | | the box, Laravel uses the Monolog PHP logging library. This gives
105 | | you a variety of powerful log handlers / formatters to utilize.
106 | |
107 | | Available Settings: "single", "daily", "syslog", "errorlog"
108 | |
109 | */
110 |
111 | 'log' => env('APP_LOG', 'single'),
112 |
113 | 'log_level' => env('APP_LOG_LEVEL', 'debug'),
114 |
115 | /*
116 | |--------------------------------------------------------------------------
117 | | Autoloaded Service Providers
118 | |--------------------------------------------------------------------------
119 | |
120 | | The service providers listed here will be automatically loaded on the
121 | | request to your application. Feel free to add your own services to
122 | | this array to grant expanded functionality to your applications.
123 | |
124 | */
125 |
126 | 'providers' => [
127 |
128 | /*
129 | * Laravel Framework Service Providers...
130 | */
131 | Illuminate\Auth\AuthServiceProvider::class,
132 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
133 | Illuminate\Bus\BusServiceProvider::class,
134 | Illuminate\Cache\CacheServiceProvider::class,
135 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
136 | Illuminate\Cookie\CookieServiceProvider::class,
137 | Illuminate\Database\DatabaseServiceProvider::class,
138 | Illuminate\Encryption\EncryptionServiceProvider::class,
139 | Illuminate\Filesystem\FilesystemServiceProvider::class,
140 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
141 | Illuminate\Hashing\HashServiceProvider::class,
142 | Illuminate\Mail\MailServiceProvider::class,
143 | Illuminate\Pagination\PaginationServiceProvider::class,
144 | Illuminate\Pipeline\PipelineServiceProvider::class,
145 | Illuminate\Queue\QueueServiceProvider::class,
146 | Illuminate\Redis\RedisServiceProvider::class,
147 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
148 | Illuminate\Session\SessionServiceProvider::class,
149 | Illuminate\Translation\TranslationServiceProvider::class,
150 | Illuminate\Validation\ValidationServiceProvider::class,
151 | Illuminate\View\ViewServiceProvider::class,
152 |
153 | /*
154 | * Application Service Providers...
155 | */
156 | App\Providers\AppServiceProvider::class,
157 | App\Providers\AuthServiceProvider::class,
158 | App\Providers\EventServiceProvider::class,
159 | App\Providers\RouteServiceProvider::class,
160 |
161 | ],
162 |
163 | /*
164 | |--------------------------------------------------------------------------
165 | | Class Aliases
166 | |--------------------------------------------------------------------------
167 | |
168 | | This array of class aliases will be registered when this application
169 | | is started. However, feel free to register as many as you wish as
170 | | the aliases are "lazy" loaded so they don't hinder performance.
171 | |
172 | */
173 |
174 | 'aliases' => [
175 |
176 | 'App' => Illuminate\Support\Facades\App::class,
177 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
178 | 'Auth' => Illuminate\Support\Facades\Auth::class,
179 | 'Blade' => Illuminate\Support\Facades\Blade::class,
180 | 'Cache' => Illuminate\Support\Facades\Cache::class,
181 | 'Config' => Illuminate\Support\Facades\Config::class,
182 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
183 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
184 | 'DB' => Illuminate\Support\Facades\DB::class,
185 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
186 | 'Event' => Illuminate\Support\Facades\Event::class,
187 | 'File' => Illuminate\Support\Facades\File::class,
188 | 'Gate' => Illuminate\Support\Facades\Gate::class,
189 | 'Hash' => Illuminate\Support\Facades\Hash::class,
190 | 'Lang' => Illuminate\Support\Facades\Lang::class,
191 | 'Log' => Illuminate\Support\Facades\Log::class,
192 | 'Mail' => Illuminate\Support\Facades\Mail::class,
193 | 'Password' => Illuminate\Support\Facades\Password::class,
194 | 'Queue' => Illuminate\Support\Facades\Queue::class,
195 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
196 | 'Redis' => Illuminate\Support\Facades\Redis::class,
197 | 'Request' => Illuminate\Support\Facades\Request::class,
198 | 'Response' => Illuminate\Support\Facades\Response::class,
199 | 'Route' => Illuminate\Support\Facades\Route::class,
200 | 'Schema' => Illuminate\Support\Facades\Schema::class,
201 | 'Session' => Illuminate\Support\Facades\Session::class,
202 | 'Storage' => Illuminate\Support\Facades\Storage::class,
203 | 'URL' => Illuminate\Support\Facades\URL::class,
204 | 'Validator' => Illuminate\Support\Facades\Validator::class,
205 | 'View' => Illuminate\Support\Facades\View::class,
206 |
207 | ],
208 |
209 | ];
210 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'token',
46 | 'provider' => 'users',
47 | ],
48 | ],
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | User Providers
53 | |--------------------------------------------------------------------------
54 | |
55 | | All authentication drivers have a user provider. This defines how the
56 | | users are actually retrieved out of your database or other storage
57 | | mechanisms used by this application to persist your user's data.
58 | |
59 | | If you have multiple user tables or models you may configure multiple
60 | | sources which represent each model / table. These sources may then
61 | | be assigned to any extra authentication guards you have defined.
62 | |
63 | | Supported: "database", "eloquent"
64 | |
65 | */
66 |
67 | 'providers' => [
68 | 'users' => [
69 | 'driver' => 'eloquent',
70 | 'model' => App\User::class,
71 | ],
72 |
73 | // 'users' => [
74 | // 'driver' => 'database',
75 | // 'table' => 'users',
76 | // ],
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Resetting Passwords
82 | |--------------------------------------------------------------------------
83 | |
84 | | Here you may set the options for resetting passwords including the view
85 | | that is your password reset e-mail. You may also set the name of the
86 | | table that maintains all of the reset tokens for your application.
87 | |
88 | | You may specify multiple password reset configurations if you have more
89 | | than one user table or model in the application and you want to have
90 | | separate password reset settings based on the specific user types.
91 | |
92 | | The expire time is the number of minutes that the reset token should be
93 | | considered valid. This security feature keeps tokens short-lived so
94 | | they have less time to be guessed. You may change this as needed.
95 | |
96 | */
97 |
98 | 'passwords' => [
99 | 'users' => [
100 | 'provider' => 'users',
101 | 'email' => 'auth.emails.password',
102 | 'table' => 'password_resets',
103 | 'expire' => 60,
104 | ],
105 | ],
106 |
107 | ];
108 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'pusher'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_KEY'),
36 | 'secret' => env('PUSHER_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | //
40 | ],
41 | ],
42 |
43 | 'redis' => [
44 | 'driver' => 'redis',
45 | 'connection' => 'default',
46 | ],
47 |
48 | 'log' => [
49 | 'driver' => 'log',
50 | ],
51 |
52 | ],
53 |
54 | ];
55 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | */
30 |
31 | 'stores' => [
32 |
33 | 'apc' => [
34 | 'driver' => 'apc',
35 | ],
36 |
37 | 'array' => [
38 | 'driver' => 'array',
39 | ],
40 |
41 | 'database' => [
42 | 'driver' => 'database',
43 | 'table' => 'cache',
44 | 'connection' => null,
45 | ],
46 |
47 | 'file' => [
48 | 'driver' => 'file',
49 | 'path' => storage_path('framework/cache'),
50 | ],
51 |
52 | 'memcached' => [
53 | 'driver' => 'memcached',
54 | 'servers' => [
55 | [
56 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
57 | 'port' => env('MEMCACHED_PORT', 11211),
58 | 'weight' => 100,
59 | ],
60 | ],
61 | ],
62 |
63 | 'redis' => [
64 | 'driver' => 'redis',
65 | 'connection' => 'default',
66 | ],
67 |
68 | ],
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Cache Key Prefix
73 | |--------------------------------------------------------------------------
74 | |
75 | | When utilizing a RAM based store such as APC or Memcached, there might
76 | | be other applications utilizing the same cache. So, we'll specify a
77 | | value to get prefixed to all our keys so we can avoid collisions.
78 | |
79 | */
80 |
81 | 'prefix' => 'laravel',
82 |
83 | ];
84 |
--------------------------------------------------------------------------------
/config/compile.php:
--------------------------------------------------------------------------------
1 | [
17 | //
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled File Providers
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may list service providers which define a "compiles" function
26 | | that returns additional files that should be compiled, providing an
27 | | easy way to get common files from any packages you are utilizing.
28 | |
29 | */
30 |
31 | 'providers' => [
32 | //
33 | ],
34 |
35 | ];
36 |
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | PDO::FETCH_CLASS,
24 |
25 | /*
26 | |--------------------------------------------------------------------------
27 | | Default Database Connection Name
28 | |--------------------------------------------------------------------------
29 | |
30 | | Here you may specify which of the database connections below you wish
31 | | to use as your default connection for all database work. Of course
32 | | you may use many connections at once using the Database library.
33 | |
34 | */
35 |
36 | 'default' => env('DB_CONNECTION', 'mysql'),
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Database Connections
41 | |--------------------------------------------------------------------------
42 | |
43 | | Here are each of the database connections setup for your application.
44 | | Of course, examples of configuring each database platform that is
45 | | supported by Laravel is shown below to make development simple.
46 | |
47 | |
48 | | All database work in Laravel is done through the PHP PDO facilities
49 | | so make sure you have the driver for your particular database of
50 | | choice installed on your machine before you begin development.
51 | |
52 | */
53 |
54 | 'connections' => [
55 |
56 | 'sqlite' => [
57 | 'driver' => 'sqlite',
58 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
59 | 'prefix' => '',
60 | ],
61 |
62 | 'mysql' => [
63 | 'driver' => 'mysql',
64 | 'host' => env('DB_HOST', $server),
65 | // 'port' => env('DB_PORT', '3306'),
66 | 'database' => env('DB_DATABASE', $database),
67 | 'username' => env('DB_USERNAME', $username),
68 | 'password' => env('DB_PASSWORD', $password),
69 | 'charset' => 'utf8',
70 | 'collation' => 'utf8_unicode_ci',
71 | 'prefix' => '',
72 | 'strict' => false,
73 | 'engine' => null,
74 | ],
75 |
76 | 'pgsql' => [
77 | 'driver' => 'pgsql',
78 | 'host' => env('DB_HOST', 'localhost'),
79 | 'port' => env('DB_PORT', '5432'),
80 | 'database' => env('DB_DATABASE', 'forge'),
81 | 'username' => env('DB_USERNAME', 'forge'),
82 | 'password' => env('DB_PASSWORD', ''),
83 | 'charset' => 'utf8',
84 | 'prefix' => '',
85 | 'schema' => 'public',
86 | ],
87 |
88 | ],
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Migration Repository Table
93 | |--------------------------------------------------------------------------
94 | |
95 | | This table keeps track of all the migrations that have already run for
96 | | your application. Using this information, we can determine which of
97 | | the migrations on disk haven't actually been run in the database.
98 | |
99 | */
100 |
101 | 'migrations' => 'migrations',
102 |
103 | /*
104 | |--------------------------------------------------------------------------
105 | | Redis Databases
106 | |--------------------------------------------------------------------------
107 | |
108 | | Redis is an open source, fast, and advanced key-value store that also
109 | | provides a richer set of commands than a typical key-value systems
110 | | such as APC or Memcached. Laravel makes it easy to dig right in.
111 | |
112 | */
113 |
114 | 'redis' => [
115 |
116 | 'cluster' => false,
117 |
118 | 'default' => [
119 | 'host' => env('REDIS_HOST', 'localhost'),
120 | 'password' => env('REDIS_PASSWORD', null),
121 | 'port' => env('REDIS_PORT', 6379),
122 | 'database' => 0,
123 | ],
124 |
125 | ],
126 |
127 | ];
128 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | 'local',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Default Cloud Filesystem Disk
23 | |--------------------------------------------------------------------------
24 | |
25 | | Many applications store files both locally and in the cloud. For this
26 | | reason, you may specify a default "cloud" driver here. This driver
27 | | will be bound as the Cloud disk implementation in the container.
28 | |
29 | */
30 |
31 | 'cloud' => 's3',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Filesystem Disks
36 | |--------------------------------------------------------------------------
37 | |
38 | | Here you may configure as many filesystem "disks" as you wish, and you
39 | | may even configure multiple disks of the same driver. Defaults have
40 | | been setup for each driver as an example of the required options.
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'visibility' => 'public',
55 | ],
56 |
57 | 's3' => [
58 | 'driver' => 's3',
59 | 'key' => 'your-key',
60 | 'secret' => 'your-secret',
61 | 'region' => 'your-region',
62 | 'bucket' => 'your-bucket',
63 | ],
64 |
65 | ],
66 |
67 | ];
68 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_DRIVER', 'smtp'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | SMTP Host Address
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may provide the host address of the SMTP server used by your
27 | | applications. A default option is provided that is compatible with
28 | | the Mailgun mail service which will provide reliable deliveries.
29 | |
30 | */
31 |
32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | SMTP Host Port
37 | |--------------------------------------------------------------------------
38 | |
39 | | This is the SMTP port used by your application to deliver e-mails to
40 | | users of the application. Like the host we have set this value to
41 | | stay compatible with the Mailgun e-mail application by default.
42 | |
43 | */
44 |
45 | 'port' => env('MAIL_PORT', 587),
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Global "From" Address
50 | |--------------------------------------------------------------------------
51 | |
52 | | You may wish for all e-mails sent by your application to be sent from
53 | | the same address. Here, you may specify a name and address that is
54 | | used globally for all e-mails that are sent by your application.
55 | |
56 | */
57 |
58 | 'from' => ['address' => null, 'name' => null],
59 |
60 | /*
61 | |--------------------------------------------------------------------------
62 | | E-Mail Encryption Protocol
63 | |--------------------------------------------------------------------------
64 | |
65 | | Here you may specify the encryption protocol that should be used when
66 | | the application send e-mail messages. A sensible default using the
67 | | transport layer security protocol should provide great security.
68 | |
69 | */
70 |
71 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
72 |
73 | /*
74 | |--------------------------------------------------------------------------
75 | | SMTP Server Username
76 | |--------------------------------------------------------------------------
77 | |
78 | | If your SMTP server requires a username for authentication, you should
79 | | set it here. This will get used to authenticate with your server on
80 | | connection. You may also set the "password" value below this one.
81 | |
82 | */
83 |
84 | 'username' => env('MAIL_USERNAME'),
85 |
86 | /*
87 | |--------------------------------------------------------------------------
88 | | SMTP Server Password
89 | |--------------------------------------------------------------------------
90 | |
91 | | Here you may set the password required by your SMTP server to send out
92 | | messages from your application. This will be given to the server on
93 | | connection so that the application will be able to send messages.
94 | |
95 | */
96 |
97 | 'password' => env('MAIL_PASSWORD'),
98 |
99 | /*
100 | |--------------------------------------------------------------------------
101 | | Sendmail System Path
102 | |--------------------------------------------------------------------------
103 | |
104 | | When using the "sendmail" driver to send e-mails, we will need to know
105 | | the path to where Sendmail lives on this server. A default path has
106 | | been provided here, which will work well on most of your systems.
107 | |
108 | */
109 |
110 | 'sendmail' => '/usr/sbin/sendmail -bs',
111 |
112 | ];
113 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_DRIVER', 'sync'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'expire' => 60,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'ttr' => 60,
49 | ],
50 |
51 | 'sqs' => [
52 | 'driver' => 'sqs',
53 | 'key' => 'your-public-key',
54 | 'secret' => 'your-secret-key',
55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
56 | 'queue' => 'your-queue-name',
57 | 'region' => 'us-east-1',
58 | ],
59 |
60 | 'redis' => [
61 | 'driver' => 'redis',
62 | 'connection' => 'default',
63 | 'queue' => 'default',
64 | 'expire' => 60,
65 | ],
66 |
67 | ],
68 |
69 | /*
70 | |--------------------------------------------------------------------------
71 | | Failed Queue Jobs
72 | |--------------------------------------------------------------------------
73 | |
74 | | These options configure the behavior of failed queue job logging so you
75 | | can control which database and table are used to store the jobs that
76 | | have failed. You may change them to any database / table you wish.
77 | |
78 | */
79 |
80 | 'failed' => [
81 | 'database' => env('DB_CONNECTION', 'mysql'),
82 | 'table' => 'failed_jobs',
83 | ],
84 |
85 | ];
86 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | ],
21 |
22 | 'mandrill' => [
23 | 'secret' => env('MANDRILL_SECRET'),
24 | ],
25 |
26 | 'ses' => [
27 | 'key' => env('SES_KEY'),
28 | 'secret' => env('SES_SECRET'),
29 | 'region' => 'us-east-1',
30 | ],
31 |
32 | 'sparkpost' => [
33 | 'secret' => env('SPARKPOST_SECRET'),
34 | ],
35 |
36 | 'stripe' => [
37 | 'model' => App\User::class,
38 | 'key' => env('STRIPE_KEY'),
39 | 'secret' => env('STRIPE_SECRET'),
40 | ],
41 |
42 | ];
43 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Session Lifetime
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may specify the number of minutes that you wish the session
27 | | to be allowed to remain idle before it expires. If you want them
28 | | to immediately expire on the browser closing, set that option.
29 | |
30 | */
31 |
32 | 'lifetime' => 120,
33 |
34 | 'expire_on_close' => false,
35 |
36 | /*
37 | |--------------------------------------------------------------------------
38 | | Session Encryption
39 | |--------------------------------------------------------------------------
40 | |
41 | | This option allows you to easily specify that all of your session data
42 | | should be encrypted before it is stored. All encryption will be run
43 | | automatically by Laravel and you can use the Session like normal.
44 | |
45 | */
46 |
47 | 'encrypt' => false,
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Session File Location
52 | |--------------------------------------------------------------------------
53 | |
54 | | When using the native session driver, we need a location where session
55 | | files may be stored. A default has been set for you but a different
56 | | location may be specified. This is only needed for file sessions.
57 | |
58 | */
59 |
60 | 'files' => storage_path('framework/sessions'),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Session Database Connection
65 | |--------------------------------------------------------------------------
66 | |
67 | | When using the "database" or "redis" session drivers, you may specify a
68 | | connection that should be used to manage these sessions. This should
69 | | correspond to a connection in your database configuration options.
70 | |
71 | */
72 |
73 | 'connection' => null,
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Session Database Table
78 | |--------------------------------------------------------------------------
79 | |
80 | | When using the "database" session driver, you may specify the table we
81 | | should use to manage the sessions. Of course, a sensible default is
82 | | provided for you; however, you are free to change this as needed.
83 | |
84 | */
85 |
86 | 'table' => 'sessions',
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Session Sweeping Lottery
91 | |--------------------------------------------------------------------------
92 | |
93 | | Some session drivers must manually sweep their storage location to get
94 | | rid of old sessions from storage. Here are the chances that it will
95 | | happen on a given request. By default, the odds are 2 out of 100.
96 | |
97 | */
98 |
99 | 'lottery' => [2, 100],
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Session Cookie Name
104 | |--------------------------------------------------------------------------
105 | |
106 | | Here you may change the name of the cookie used to identify a session
107 | | instance by ID. The name specified here will get used every time a
108 | | new session cookie is created by the framework for every driver.
109 | |
110 | */
111 |
112 | 'cookie' => 'laravel_session',
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Session Cookie Path
117 | |--------------------------------------------------------------------------
118 | |
119 | | The session cookie path determines the path for which the cookie will
120 | | be regarded as available. Typically, this will be the root path of
121 | | your application but you are free to change this when necessary.
122 | |
123 | */
124 |
125 | 'path' => '/',
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | Session Cookie Domain
130 | |--------------------------------------------------------------------------
131 | |
132 | | Here you may change the domain of the cookie used to identify a session
133 | | in your application. This will determine which domains the cookie is
134 | | available to in your application. A sensible default has been set.
135 | |
136 | */
137 |
138 | 'domain' => env('SESSION_DOMAIN', null),
139 |
140 | /*
141 | |--------------------------------------------------------------------------
142 | | HTTPS Only Cookies
143 | |--------------------------------------------------------------------------
144 | |
145 | | By setting this option to true, session cookies will only be sent back
146 | | to the server if the browser has a HTTPS connection. This will keep
147 | | the cookie from being sent to you if it can not be done securely.
148 | |
149 | */
150 |
151 | 'secure' => false,
152 |
153 | /*
154 | |--------------------------------------------------------------------------
155 | | HTTP Access Only
156 | |--------------------------------------------------------------------------
157 | |
158 | | Setting this value to true will prevent JavaScript from accessing the
159 | | value of the cookie and the cookie will only be accessible through
160 | | the HTTP protocol. You are free to modify this option if needed.
161 | |
162 | */
163 |
164 | 'http_only' => true,
165 |
166 | ];
167 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | realpath(base_path('resources/views')),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => realpath(storage_path('framework/views')),
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/database/factories/ModelFactory.php:
--------------------------------------------------------------------------------
1 | define(App\User::class, function (Faker\Generator $faker) {
15 | return [
16 | 'name' => $faker->name,
17 | 'email' => $faker->safeEmail,
18 | 'password' => bcrypt(str_random(10)),
19 | 'remember_token' => str_random(10),
20 | ];
21 | });
22 |
--------------------------------------------------------------------------------
/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->string('name');
18 | $table->string('email')->unique();
19 | $table->string('password');
20 | $table->integer('is_admin')->unsigned()->default(0);
21 | $table->rememberToken();
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::drop('users');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
17 | $table->string('token')->index();
18 | $table->timestamp('created_at')->nullable();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::drop('password_resets');
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/database/migrations/2016_06_25_091542_create_tickets_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->integer('user_id')->unsigned();
18 | $table->integer('category_id')->unsigned();
19 | $table->string('ticket_id')->unique();
20 | $table->string('title');
21 | $table->string('priority');
22 | $table->text('message');
23 | $table->string('status');
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::drop('tickets');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/2016_06_25_102115_create_categories_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->string('name');
18 | $table->timestamps();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::drop('categories');
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/database/migrations/2016_07_02_160300_create_comments_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->integer('ticket_id')->unsigned();
18 | $table->integer('user_id')->unsigned();
19 | $table->text('comment');
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::drop('comments');
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var elixir = require('laravel-elixir');
2 |
3 | /*
4 | |--------------------------------------------------------------------------
5 | | Elixir Asset Management
6 | |--------------------------------------------------------------------------
7 | |
8 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks
9 | | for your Laravel application. By default, we are compiling the Sass
10 | | file for our application, as well as publishing vendor resources.
11 | |
12 | */
13 |
14 | elixir(function(mix) {
15 | mix.sass('app.scss');
16 | });
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "prod": "gulp --production",
5 | "dev": "gulp watch"
6 | },
7 | "devDependencies": {
8 | "gulp": "^3.9.1",
9 | "laravel-elixir": "^5.0.0",
10 | "bootstrap-sass": "^3.3.0"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 | {{ $comment->comment }} 10 |
11 | 12 | --- 13 |Replied by: {{ $user->name }}
14 | 15 |Title: {{ $ticket->title }}
16 |Title: {{ $ticket->ticket_id }}
17 |Status: {{ $ticket->status }}
18 | 19 |20 | You can view the ticket at any time at {{ url('tickets/'. $ticket->ticket_id) }} 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /resources/views/emails/ticket_info.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |9 | Thank you {{ ucfirst($user->name) }} for contacting our support team. A support ticket has been opened for you. You will be notified when a response is made by email. The details of your ticket are shown below: 10 |
11 | 12 |Title: {{ $ticket->title }}
13 |Priority: {{ $ticket->priority }}
14 |Status: {{ $ticket->status }}
15 | 16 |17 | You can view the ticket at any time at {{ url('tickets/'. $ticket->ticket_id) }} 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /resources/views/emails/ticket_status.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |9 | Hello {{ ucfirst($ticketOwner->name) }}, 10 |
11 |12 | Your support ticket with ID #{{ $ticket->ticket_id }} has been marked has resolved and closed. 13 |
14 | 15 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |You are logged in!
14 | 15 | @if (Auth::user()->is_admin) 16 |17 | See all tickets 18 |
19 | @else 20 |21 | See all your tickets or open new ticket 22 |
23 | @endif 24 |There are currently no tickets.
16 | @else 17 |Category | 21 |Title | 22 |Status | 23 |Last Updated | 24 |Actions | 25 ||
---|---|---|---|---|---|
31 | @foreach ($categories as $category) 32 | @if ($category->id === $ticket->category_id) 33 | {{ $category->name }} 34 | @endif 35 | @endforeach 36 | | 37 |38 | 39 | #{{ $ticket->ticket_id }} - {{ $ticket->title }} 40 | 41 | | 42 |43 | @if ($ticket->status === 'Open') 44 | {{ $ticket->status }} 45 | @else 46 | {{ $ticket->status }} 47 | @endif 48 | | 49 |{{ $ticket->updated_at }} | 50 |51 | Comment 52 | | 53 |54 | 58 | | 59 |
{{ $ticket->message }}
18 |Categry: {{ $category->name }}
19 |20 | @if ($ticket->status === 'Open') 21 | Status: {{ $ticket->status }} 22 | @else 23 | Status: {{ $ticket->status }} 24 | @endif 25 |
26 |Created on: {{ $ticket->created_at->diffForHumans() }}
27 |You have not created any tickets.
16 | @else 17 |Category | 21 |Title | 22 |Status | 23 |Last Updated | 24 |
---|---|---|---|
30 | @foreach ($categories as $category) 31 | @if ($category->id === $ticket->category_id) 32 | {{ $category->name }} 33 | @endif 34 | @endforeach 35 | | 36 |37 | 38 | #{{ $ticket->ticket_id }} - {{ $ticket->title }} 39 | 40 | | 41 |42 | @if ($ticket->status === 'Open') 43 | {{ $ticket->status }} 44 | @else 45 | {{ $ticket->status }} 46 | @endif 47 | | 48 |{{ $ticket->updated_at }} | 49 |