Skip to content

Commit 6b84515

Browse files
committed
init
0 parents  commit 6b84515

File tree

142 files changed

+15727
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+15727
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[docker-compose.yml]
18+
indent_size = 4

.env.example

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
LOG_DEPRECATIONS_CHANNEL=null
9+
LOG_LEVEL=debug
10+
11+
DB_CONNECTION=sqlite
12+
13+
BROADCAST_DRIVER=log
14+
CACHE_DRIVER=file
15+
FILESYSTEM_DISK=local
16+
QUEUE_CONNECTION=redis
17+
SESSION_DRIVER=file
18+
SESSION_LIFETIME=120
19+
20+
REDIS_HOST=127.0.0.1
21+
REDIS_PASSWORD=null
22+
REDIS_PORT=6379
23+
24+
MEMCACHED_HOST=127.0.0.1
25+
26+
REDIS_HOST=127.0.0.1
27+
REDIS_PASSWORD=null
28+
REDIS_PORT=6379
29+
30+
MAIL_MAILER=smtp
31+
MAIL_HOST=mailhog
32+
MAIL_PORT=1025
33+
MAIL_USERNAME=null
34+
MAIL_PASSWORD=null
35+
MAIL_ENCRYPTION=null
36+
MAIL_FROM_ADDRESS="hello@example.com"
37+
MAIL_FROM_NAME="${APP_NAME}"
38+
39+
AWS_ACCESS_KEY_ID=
40+
AWS_SECRET_ACCESS_KEY=
41+
AWS_DEFAULT_REGION=us-east-1
42+
AWS_BUCKET=
43+
AWS_USE_PATH_STYLE_ENDPOINT=false
44+
45+
PUSHER_APP_ID=
46+
PUSHER_APP_KEY=
47+
PUSHER_APP_SECRET=
48+
PUSHER_HOST=
49+
PUSHER_PORT=443
50+
PUSHER_SCHEME=https
51+
PUSHER_APP_CLUSTER=mt1
52+
53+
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
54+
VITE_PUSHER_HOST="${PUSHER_HOST}"
55+
VITE_PUSHER_PORT="${PUSHER_PORT}"
56+
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
57+
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
10+
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/node_modules
2+
/public/build
3+
/public/hot
4+
/public/storage
5+
/storage/*.key
6+
/vendor
7+
.env
8+
.env.backup
9+
.phpunit.result.cache
10+
Homestead.json
11+
Homestead.yaml
12+
auth.json
13+
npm-debug.log
14+
yarn-error.log
15+
/.idea
16+
/.vscode

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Introduction
2+
This project demo is to demonstrate on how [laravel-csv](https://github.com/coderflexx/laravel-csv) works
3+
4+
# Installation
5+
6+
Clone the repo
7+
8+
```bash
9+
git clone https://github.com/coderflexx/laravel-csv-demo
10+
```
11+
12+
Install the dependecies
13+
```bash
14+
composer install
15+
npm install
16+
npm run dev
17+
```
18+
19+
Copy the `.env` file
20+
```
21+
cp .env.example .env
22+
```
23+
24+
Generate a new key
25+
```bash
26+
php artisan key:generate
27+
```
28+
Then
29+
30+
```bash
31+
php artisan migrate --seed
32+
```
33+
34+
Access the app
35+
__Email__: test@example.com
36+
__Password__: password
37+
38+
__NOTE__: This project is using `sqlite` by default, if you want to switch to `mysql` or any DB driver, you may change the driver from the `.env` file.
39+
40+
This project uses `redis` as a queue driver, if you want to change it, you may change your `.env` file configuration as well, or install redis in your local machine.

app/Console/Kernel.php

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* Define the application's command schedule.
12+
*
13+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
14+
* @return void
15+
*/
16+
protected function schedule(Schedule $schedule)
17+
{
18+
// $schedule->command('inspire')->hourly();
19+
}
20+
21+
/**
22+
* Register the commands for the application.
23+
*
24+
* @return void
25+
*/
26+
protected function commands()
27+
{
28+
$this->load(__DIR__.'/Commands');
29+
30+
require base_path('routes/console.php');
31+
}
32+
}

app/Exceptions/Handler.php

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6+
use Throwable;
7+
8+
class Handler extends ExceptionHandler
9+
{
10+
/**
11+
* A list of exception types with their corresponding custom log levels.
12+
*
13+
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
14+
*/
15+
protected $levels = [
16+
//
17+
];
18+
19+
/**
20+
* A list of the exception types that are not reported.
21+
*
22+
* @var array<int, class-string<\Throwable>>
23+
*/
24+
protected $dontReport = [
25+
//
26+
];
27+
28+
/**
29+
* A list of the inputs that are never flashed to the session on validation exceptions.
30+
*
31+
* @var array<int, string>
32+
*/
33+
protected $dontFlash = [
34+
'current_password',
35+
'password',
36+
'password_confirmation',
37+
];
38+
39+
/**
40+
* Register the exception handling callbacks for the application.
41+
*
42+
* @return void
43+
*/
44+
public function register()
45+
{
46+
$this->reportable(function (Throwable $e) {
47+
//
48+
});
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Http\Requests\Auth\LoginRequest;
7+
use App\Providers\RouteServiceProvider;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Auth;
10+
11+
class AuthenticatedSessionController extends Controller
12+
{
13+
/**
14+
* Display the login view.
15+
*
16+
* @return \Illuminate\View\View
17+
*/
18+
public function create()
19+
{
20+
return view('auth.login');
21+
}
22+
23+
/**
24+
* Handle an incoming authentication request.
25+
*
26+
* @param \App\Http\Requests\Auth\LoginRequest $request
27+
* @return \Illuminate\Http\RedirectResponse
28+
*/
29+
public function store(LoginRequest $request)
30+
{
31+
$request->authenticate();
32+
33+
$request->session()->regenerate();
34+
35+
return redirect()->intended(RouteServiceProvider::HOME);
36+
}
37+
38+
/**
39+
* Destroy an authenticated session.
40+
*
41+
* @param \Illuminate\Http\Request $request
42+
* @return \Illuminate\Http\RedirectResponse
43+
*/
44+
public function destroy(Request $request)
45+
{
46+
Auth::guard('web')->logout();
47+
48+
$request->session()->invalidate();
49+
50+
$request->session()->regenerateToken();
51+
52+
return redirect('/');
53+
}
54+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\Request;
8+
use Illuminate\Support\Facades\Auth;
9+
use Illuminate\Validation\ValidationException;
10+
11+
class ConfirmablePasswordController extends Controller
12+
{
13+
/**
14+
* Show the confirm password view.
15+
*
16+
* @return \Illuminate\View\View
17+
*/
18+
public function show()
19+
{
20+
return view('auth.confirm-password');
21+
}
22+
23+
/**
24+
* Confirm the user's password.
25+
*
26+
* @param \Illuminate\Http\Request $request
27+
* @return mixed
28+
*/
29+
public function store(Request $request)
30+
{
31+
if (! Auth::guard('web')->validate([
32+
'email' => $request->user()->email,
33+
'password' => $request->password,
34+
])) {
35+
throw ValidationException::withMessages([
36+
'password' => __('auth.password'),
37+
]);
38+
}
39+
40+
$request->session()->put('auth.password_confirmed_at', time());
41+
42+
return redirect()->intended(RouteServiceProvider::HOME);
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\Request;
8+
9+
class EmailVerificationNotificationController extends Controller
10+
{
11+
/**
12+
* Send a new email verification notification.
13+
*
14+
* @param \Illuminate\Http\Request $request
15+
* @return \Illuminate\Http\RedirectResponse
16+
*/
17+
public function store(Request $request)
18+
{
19+
if ($request->user()->hasVerifiedEmail()) {
20+
return redirect()->intended(RouteServiceProvider::HOME);
21+
}
22+
23+
$request->user()->sendEmailVerificationNotification();
24+
25+
return back()->with('status', 'verification-link-sent');
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\Request;
8+
9+
class EmailVerificationPromptController extends Controller
10+
{
11+
/**
12+
* Display the email verification prompt.
13+
*
14+
* @param \Illuminate\Http\Request $request
15+
* @return mixed
16+
*/
17+
public function __invoke(Request $request)
18+
{
19+
return $request->user()->hasVerifiedEmail()
20+
? redirect()->intended(RouteServiceProvider::HOME)
21+
: view('auth.verify-email');
22+
}
23+
}

0 commit comments

Comments
 (0)