├── public ├── favicon.ico ├── robots.txt ├── mix-manifest.json ├── .htaccess ├── web.config └── index.php ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── cache │ ├── data │ │ └── .gitignore │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── database ├── .gitignore ├── seeds │ ├── DatabaseSeeder.php │ └── UsersTableSeeder.php ├── migrations │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2020_01_11_034610_create_packages_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2019_12_29_131125_create_reminders_table.php │ ├── 2019_10_21_013218_create_leads_table.php │ └── 2020_01_11_032608_create_subscribers_table.php └── factories │ └── UserFactory.php ├── .gitattributes ├── .idea ├── misc.xml ├── vcs.xml ├── laravel-plugin.xml ├── modules.xml ├── php.xml └── FitnessForce.iml ├── app ├── Models │ ├── Package.php │ ├── Lead.php │ ├── Subscriber.php │ └── Reminder.php ├── Http │ ├── Controllers │ │ ├── WelcomeController.php │ │ ├── Controller.php │ │ ├── SubscriberController.php │ │ ├── HomeController.php │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── ResetPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── ConfirmPasswordController.php │ │ │ ├── VerificationController.php │ │ │ └── RegisterController.php │ │ ├── DashboardController.php │ │ ├── ReminderController.php │ │ ├── PackageController.php │ │ ├── LeadSubscriberController.php │ │ └── LeadController.php │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ ├── Authenticate.php │ │ ├── VerifyCsrfToken.php │ │ └── RedirectIfAuthenticated.php │ └── Kernel.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ ├── RouteServiceProvider.php │ └── AppServiceProvider.php ├── Mail │ └── ReminderEmailDigest.php ├── User.php ├── Console │ ├── Kernel.php │ └── Commands │ │ └── SendReminderEmails.php └── Exceptions │ └── Handler.php ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── .gitignore ├── .editorconfig ├── .styleci.yml ├── resources ├── sass │ ├── _variables.scss │ └── app.scss ├── views │ ├── app.blade.php │ ├── emails │ │ └── reminder-digest.blade.php │ ├── home.blade.php │ ├── auth │ │ ├── verify.blade.php │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ ├── confirm.blade.php │ │ │ └── reset.blade.php │ │ ├── login.blade.php │ │ └── register.blade.php │ ├── welcome.blade.php │ └── layouts │ │ └── app.blade.php ├── js │ ├── app.js │ ├── components │ │ └── ExampleComponent.vue │ ├── Pages │ │ ├── Dashboard │ │ │ ├── Index.vue │ │ │ ├── ReminderList.vue │ │ │ └── RemindersList.vue │ │ ├── Leads │ │ │ ├── LeadAdd.vue │ │ │ ├── ReminderForm.vue │ │ │ ├── LeadReminderAdd.vue │ │ │ ├── ReminderNote.vue │ │ │ ├── Index.vue │ │ │ ├── LeadView.vue │ │ │ └── ReminderView.vue │ │ ├── Packages │ │ │ ├── PackageView.vue │ │ │ ├── PackageAddForm.vue │ │ │ └── Index.vue │ │ └── Subscribers │ │ │ ├── SubscriberAdd.vue │ │ │ ├── Index.vue │ │ │ └── SubsriberForm.vue │ ├── Shared │ │ ├── AlertMessages.vue │ │ ├── Pagination.vue │ │ ├── Layout.vue │ │ └── LeadForm.vue │ └── bootstrap.js └── lang │ └── en │ ├── pagination.php │ ├── auth.php │ └── passwords.php ├── routes ├── channels.php ├── api.php ├── console.php └── web.php ├── webpack.mix.js ├── idea.txt ├── server.php ├── .env.example ├── config ├── services.php ├── view.php ├── hashing.php ├── broadcasting.php ├── filesystems.php ├── queue.php ├── logging.php ├── cache.php ├── auth.php ├── mail.php ├── database.php └── session.php ├── phpunit.xml ├── package.json ├── artisan ├── composer.json └── readme.md /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /app/Models/Package.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/laravel-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | enabled: 4 | - alpha_ordered_imports 5 | disabled: 6 | - length_ordered_imports 7 | - unused_use 8 | finder: 9 | not-name: 10 | - index.php 11 | - server.php 12 | js: 13 | finder: 14 | not-name: 15 | - webpack.mix.js 16 | css: true 17 | -------------------------------------------------------------------------------- /app/Models/Lead.php: -------------------------------------------------------------------------------- 1 | hasMany(Reminder::class) 14 | ->orderByDesc('id'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Models/Subscriber.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | $this->call(InitialDataSeeder::class); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Models/Reminder.php: -------------------------------------------------------------------------------- 1 | belongsTo(Lead::class); 14 | } 15 | 16 | public function getStatusAttribute($value) 17 | { 18 | return ucfirst($value); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/views/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | FitApp 9 | @routes 10 | 11 | 12 | @inertia 13 | 14 | 15 | -------------------------------------------------------------------------------- /resources/views/emails/reminder-digest.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::message') 2 | # You have some reminders to follow up. Below are their details: 3 | 4 | @component('mail::table') 5 | |Reminder|Lead name|Phone| 6 | |:-------|:--------|:----| 7 | @foreach($reminders as $reminder) 8 | |{{$reminder['reminder']}}|{{$reminder['lead']['name']}}|{{$reminder['lead']['phone']}} 9 | @endforeach 10 | @endcomponent 11 | 12 | Thanks,
13 | {{ config('app.name') }} 14 | @endcomponent 15 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | orderBy('renewal_date') 15 | ->paginate(10); 16 | 17 | return Inertia::render('Subscribers/Index', [ 18 | 'subscribers' => $subscribers, 19 | ]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | route(...args).url() 7 | Vue.use(InertiaApp) 8 | 9 | const app = document.getElementById('app') 10 | 11 | if (app) { 12 | new Vue({ 13 | render: h => h(InertiaApp, { 14 | props: { 15 | initialPage: JSON.parse(app.dataset.page), 16 | resolveComponent: name => require(`./Pages/${name}`).default, 17 | }, 18 | }), 19 | }).$mount(app) 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Contracts\Support\Renderable 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /idea.txt: -------------------------------------------------------------------------------- 1 | Package 2 | - id 3 | - name 4 | - amount 5 | - number_of_days 6 | - status (active/inactive) 7 | 8 | Subscriber 9 | - id 10 | - lead_id 11 | - package_id 12 | - renewal_date 13 | - amount_due 14 | - created_at 15 | - updated_at 16 | 17 | Subscription History 18 | - id 19 | - subscriber_id 20 | - package_id 21 | - amount 22 | - renewal_date 23 | - created_at 24 | - updated_at 25 | 26 | Button to convert a lead to a subscriber. 27 | Pop up to confirm the package that the user wants to select. Prefill the current one by default. 28 | Show the start date as today, and when the next renewal will be along with the amount. 29 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/dashboard'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | 'Amitav Roy', 17 | 'email' => 'reachme@amitavroy.com', 18 | 'password' => bcrypt('password'), 19 | ]); 20 | 21 | User::create([ 22 | 'name' => 'Jhon Doe', 23 | 'email' => 'jhon.doe@amitavroy.com', 24 | 'password' => bcrypt('password'), 25 | ]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Dashboard
9 | 10 |
11 | @if (session('status')) 12 | 15 | @endif 16 | 17 | You are logged in! 18 |
19 |
20 |
21 |
22 |
23 | @endsection 24 | -------------------------------------------------------------------------------- /resources/js/Pages/Dashboard/Index.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 30 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have e-mailed your password reset link!', 18 | 'token' => 'This password reset token is invalid.', 19 | 'user' => "We can't find a user with that e-mail address.", 20 | 21 | ]; 22 | -------------------------------------------------------------------------------- /app/Http/Controllers/DashboardController.php: -------------------------------------------------------------------------------- 1 | with(['lead']) 15 | ->where('reminders.reminder_date', now()->format('Y-m-d')) 16 | ->where('reminders.user_id', Auth::user()->id) 17 | ->where('reminders.status', 'pending') 18 | ->get(); 19 | 20 | $data = [ 21 | 'fname' => 'Amitav', 22 | 'lname' => 'Roy', 23 | 'reminders' => $reminds 24 | ]; 25 | 26 | return Inertia::render('Dashboard/Index', $data); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /resources/js/Pages/Dashboard/ReminderList.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 26 | -------------------------------------------------------------------------------- /app/Mail/ReminderEmailDigest.php: -------------------------------------------------------------------------------- 1 | reminders = $reminders; 24 | } 25 | 26 | /** 27 | * Build the message. 28 | * 29 | * @return $this 30 | */ 31 | public function build() 32 | { 33 | return $this->markdown('emails.reminder-digest') 34 | ->with('reminders', $this->reminders); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | parent::boot(); 31 | 32 | // 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/js/Pages/Dashboard/RemindersList.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 26 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 38 | ]; 39 | } 40 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 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 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=laravel 13 | DB_USERNAME=root 14 | DB_PASSWORD= 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=file 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | AWS_ACCESS_KEY_ID= 34 | AWS_SECRET_ACCESS_KEY= 35 | AWS_DEFAULT_REGION=us-east-1 36 | AWS_BUCKET= 37 | 38 | PUSHER_APP_ID= 39 | PUSHER_APP_KEY= 40 | PUSHER_APP_SECRET= 41 | PUSHER_APP_CLUSTER=mt1 42 | 43 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 44 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 45 | -------------------------------------------------------------------------------- /resources/js/Shared/AlertMessages.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->text('connection'); 19 | $table->text('queue'); 20 | $table->longText('payload'); 21 | $table->longText('exception'); 22 | $table->timestamp('failed_at')->useCurrent(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('failed_jobs'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2020_01_11_034610_create_packages_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->float('amount', 10, 2); 20 | $table->unsignedInteger('number_of_days'); 21 | $table->string('status')->default('active'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('packages'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 20 | return [ 21 | 'name' => $faker->name, 22 | 'email' => $faker->unique()->safeEmail, 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | }); 28 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /resources/js/Shared/Pagination.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 32 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 29 | // ->hourly(); 30 | } 31 | 32 | /** 33 | * Register the commands for the application. 34 | * 35 | * @return void 36 | */ 37 | protected function commands() 38 | { 39 | $this->load(__DIR__.'/Commands'); 40 | 41 | require base_path('routes/console.php'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2019_12_29_131125_create_reminders_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('lead_id'); 19 | $table->unsignedBigInteger('user_id'); 20 | $table->text('reminder')->nullable(); 21 | $table->text('note')->nullable(); 22 | $table->date('reminder_date')->nullable(); 23 | $table->string('status'); 24 | $table->timestamps(); 25 | 26 | $table->index(['lead_id']); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('reminders'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ConfirmPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('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' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/migrations/2019_10_21_013218_create_leads_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->string('email'); 20 | $table->string('phone'); 21 | $table->integer('age'); 22 | $table->string('interested_package')->nullable(); 23 | $table->date('dob'); 24 | $table->unsignedBigInteger('branch_id'); 25 | $table->unsignedBigInteger('added_by'); 26 | $table->boolean('active')->default(1); 27 | $table->timestamps(); 28 | 29 | $table->index(['phone', 'branch_id']); 30 | }); 31 | } 32 | 33 | /** 34 | * Reverse the migrations. 35 | * 36 | * @return void 37 | */ 38 | public function down() 39 | { 40 | Schema::dropIfExists('leads'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/views/auth/verify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Verify Your Email Address') }}
9 | 10 |
11 | @if (session('resent')) 12 | 15 | @endif 16 | 17 | {{ __('Before proceeding, please check your email for a verification link.') }} 18 | {{ __('If you did not receive the email') }}, 19 |
20 | @csrf 21 | . 22 |
23 |
24 |
25 |
26 |
27 |
28 | @endsection 29 | -------------------------------------------------------------------------------- /resources/js/Pages/Leads/LeadAdd.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 51 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerificationController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 38 | $this->middleware('signed')->only('verify'); 39 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Unit 14 | 15 | 16 | 17 | ./tests/Feature 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/js/Pages/Packages/PackageView.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 47 | -------------------------------------------------------------------------------- /resources/js/Pages/Leads/ReminderForm.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 51 | -------------------------------------------------------------------------------- /resources/js/Pages/Subscribers/SubscriberAdd.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 51 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "bootstrap": "^4.0.0", 14 | "cross-env": "^5.1", 15 | "jquery": "^3.5", 16 | "laravel-mix": "^4.0.7", 17 | "lodash": "^4.17.21", 18 | "popper.js": "^1.12", 19 | "resolve-url-loader": "^2.3.1", 20 | "sass": "^1.20.1", 21 | "sass-loader": "7.*", 22 | "vue": "^2.5.17", 23 | "vue-template-compiler": "^2.6.10" 24 | }, 25 | "dependencies": { 26 | "@inertiajs/inertia": "^0.1.7", 27 | "@inertiajs/inertia-vue": "^0.1.2", 28 | "axios": "^0.27.2", 29 | "moment": "^2.24.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 5 | * for JavaScript based Bootstrap features such as modals and tabs. This 6 | * code may be modified to fit the specific needs of your application. 7 | */ 8 | 9 | try { 10 | window.Popper = require('popper.js').default; 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | window.axios = require('axios'); 23 | 24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Echo exposes an expressive API for subscribing to channels and listening 28 | * for events that are broadcast by Laravel. Echo and event broadcasting 29 | * allows your team to easily build robust real-time web applications. 30 | */ 31 | 32 | // import Echo from 'laravel-echo'; 33 | 34 | // window.Pusher = require('pusher-js'); 35 | 36 | // window.Echo = new Echo({ 37 | // broadcaster: 'pusher', 38 | // key: process.env.MIX_PUSHER_APP_KEY, 39 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 40 | // encrypted: true 41 | // }); 42 | -------------------------------------------------------------------------------- /database/migrations/2020_01_11_032608_create_subscribers_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('lead_id'); 19 | $table->unsignedBigInteger('package_id'); 20 | $table->timestamp('renewal_date'); 21 | $table->float('amount', 10, 2); 22 | 23 | $table->string('name'); 24 | $table->string('email'); 25 | $table->string('phone'); 26 | $table->integer('age'); 27 | $table->string('interested_package')->nullable(); 28 | $table->date('dob'); 29 | $table->unsignedBigInteger('branch_id'); 30 | $table->unsignedBigInteger('added_by'); 31 | 32 | $table->timestamps(); 33 | 34 | $table->index(['lead_id', 'package_id', 'renewal_date']); 35 | }); 36 | } 37 | 38 | /** 39 | * Reverse the migrations. 40 | * 41 | * @return void 42 | */ 43 | public function down() 44 | { 45 | Schema::dropIfExists('subscribers'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /app/Http/Controllers/ReminderController.php: -------------------------------------------------------------------------------- 1 | $lead 16 | ]); 17 | } 18 | 19 | public function store(Request $request) 20 | { 21 | $postData = $this->validate($request, [ 22 | 'reminder' => 'required|min:3', 23 | 'reminder_date' => 'required|date', 24 | 'lead_id' => 'required|exists:leads,id' 25 | ]); 26 | 27 | $postData['user_id'] = $request->user()->id; 28 | $postData['status'] = 'pending'; 29 | 30 | $lead = Lead::find($postData['lead_id']); 31 | 32 | $lead->reminders() 33 | ->create($postData); 34 | 35 | return redirect() 36 | ->route('lead.view', [$lead]); 37 | } 38 | 39 | public function view(Lead $lead, Reminder $reminder) 40 | { 41 | return Inertia::render('Leads/ReminderView', [ 42 | 'lead' => $lead, 43 | 'reminder' => $reminder, 44 | ]); 45 | } 46 | 47 | public function updateAndCreate(Request $request) 48 | { 49 | $postData = $this->validate($request, [ 50 | 'reminder_id' => 'required|exists:reminders,id', 51 | ]); 52 | 53 | $reminder = Reminder::findOrFail($postData['reminder_id']); 54 | $reminder->status = 'completed'; 55 | $reminder->save(); 56 | 57 | $lead = Lead::find($reminder->lead_id); 58 | 59 | return redirect(route('reminder.add', ['lead' => $lead])); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /resources/js/Pages/Packages/PackageAddForm.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 61 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/Console/Commands/SendReminderEmails.php: -------------------------------------------------------------------------------- 1 | with(['lead']) 47 | ->where('reminder_date', now()->format('Y-m-d')) 48 | ->where('status', 'pending') 49 | ->orderByDesc('user_id') 50 | ->get(); 51 | 52 | // group all reminders by user 53 | $data = []; 54 | foreach ($reminders as $reminder) { 55 | $data[$reminder->user_id][] = $reminder->toArray(); 56 | } 57 | 58 | foreach ($data as $userId => $reminders) { 59 | $this->sendEmailToUser($userId, $reminders); 60 | } 61 | } 62 | 63 | private function sendEmailToUser($userId, $reminders) 64 | { 65 | $user = User::find($userId); 66 | 67 | Mail::to($user)->send(new ReminderEmailDigest($reminders)); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 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_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 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 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /app/Http/Controllers/PackageController.php: -------------------------------------------------------------------------------- 1 | rules = [ 16 | 'name' => 'required', 17 | 'amount' => 'required|numeric|min:1', 18 | 'number_of_days' => 'required|min:1', 19 | ]; 20 | } 21 | public function index() 22 | { 23 | $packages = Package::query() 24 | ->where('status', 'active') 25 | ->orderBy('number_of_days', 'asc') 26 | ->get(); 27 | 28 | return Inertia::render('Packages/Index', [ 29 | 'activePackages' => $packages 30 | ]); 31 | } 32 | 33 | public function store(Request $request) 34 | { 35 | $postData = $this->validate($request, $this->rules); 36 | 37 | $postData['status'] = 'active'; 38 | 39 | Package::create($postData); 40 | 41 | return redirect()->route('package.list'); 42 | } 43 | 44 | public function view(Package $package) 45 | { 46 | return Inertia::render('Packages/PackageView', [ 47 | 'package' => $package 48 | ]); 49 | } 50 | 51 | public function update(Request $request) 52 | { 53 | $rules = $this->rules; 54 | 55 | $rules['id'] = 'required|exists:packages,id'; 56 | 57 | $postData = $this->validate($request, $rules); 58 | 59 | $package = Package::find($postData['id']); 60 | $package->name = $postData['name']; 61 | $package->amount = $postData['amount']; 62 | $package->number_of_days = $postData['number_of_days']; 63 | $package->save(); 64 | 65 | return redirect() 66 | ->route('package.list'); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.2", 12 | "fideloper/proxy": "^4.0", 13 | "inertiajs/inertia-laravel": "^0.1.3", 14 | "laravel/framework": "^6.0", 15 | "laravel/tinker": "^1.0", 16 | "laravel/ui": "^1.1", 17 | "predis/predis": "^1.1", 18 | "tightenco/ziggy": "^0.8.1" 19 | }, 20 | "require-dev": { 21 | "facade/ignition": "^1.4", 22 | "fzaninotto/faker": "^1.4", 23 | "mockery/mockery": "^1.0", 24 | "nunomaduro/collision": "^3.0", 25 | "phpunit/phpunit": "^8.0" 26 | }, 27 | "config": { 28 | "optimize-autoloader": true, 29 | "preferred-install": "dist", 30 | "sort-packages": true 31 | }, 32 | "extra": { 33 | "laravel": { 34 | "dont-discover": [] 35 | } 36 | }, 37 | "autoload": { 38 | "psr-4": { 39 | "App\\": "app/" 40 | }, 41 | "classmap": [ 42 | "database/seeds", 43 | "database/factories" 44 | ] 45 | }, 46 | "autoload-dev": { 47 | "psr-4": { 48 | "Tests\\": "tests/" 49 | } 50 | }, 51 | "minimum-stability": "dev", 52 | "prefer-stable": true, 53 | "scripts": { 54 | "post-autoload-dump": [ 55 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 56 | "@php artisan package:discover --ansi" 57 | ], 58 | "post-root-package-install": [ 59 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 60 | ], 61 | "post-create-project-cmd": [ 62 | "@php artisan key:generate --ansi" 63 | ] 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /app/Http/Controllers/LeadSubscriberController.php: -------------------------------------------------------------------------------- 1 | where('status', 'active') 17 | ->orderByDesc('id') 18 | ->get(); 19 | 20 | return Inertia::render('Subscribers/SubscriberAdd', [ 21 | 'lead' => $lead, 22 | 'packages' => $packages 23 | ]); 24 | } 25 | 26 | public function store(Request $request) 27 | { 28 | $postData = $this->validate($request, [ 29 | 'name' => 'required', 30 | 'package_id' => 'required|exists:packages,id', 31 | 'lead_id' => 'required|exists:leads,id', 32 | 'renewal_date' => 'required|date|date_format:"Y-m-d"', 33 | 'amount' => 'required', 34 | ]); 35 | 36 | $package = Package::find($postData['package_id']); 37 | $lead = Lead::find($postData['lead_id']); 38 | 39 | Subscriber::create([ 40 | 'lead_id' => $postData['lead_id'], 41 | 'package_id' => $package->id, 42 | 'renewal_date' => now()->addDays($package->number_of_days)->format('Y-m-d'), 43 | 'amount' => $package->amount, 44 | 45 | 'name' => $lead['name'], 46 | 'email' => $lead['email'], 47 | 'phone' => $lead['phone'], 48 | 'age' => $lead['age'], 49 | 'dob' => $lead['dob'], 50 | 'branch_id' => $lead['branch_id'], 51 | 'added_by' => $lead['added_by'], 52 | 'interested_package' => $package->name 53 | ]); 54 | 55 | $lead->active = 0; 56 | $lead->save(); 57 | 58 | return redirect() 59 | ->route('lead.subscribe', ['lead' => $lead]) 60 | ->with('success', 'Subscriber added'); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /resources/js/Pages/Leads/LeadReminderAdd.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 77 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 | @if (session('status')) 12 | 15 | @endif 16 | 17 |
18 | @csrf 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @error('email') 27 | 28 | {{ $message }} 29 | 30 | @enderror 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /resources/js/Pages/Subscribers/Index.vue: -------------------------------------------------------------------------------- 1 | 51 | 52 | 66 | -------------------------------------------------------------------------------- /resources/js/Pages/Packages/Index.vue: -------------------------------------------------------------------------------- 1 | 45 | 72 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/confirm.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Confirm Password') }}
9 | 10 |
11 | {{ __('Please confirm your password before continuing.') }} 12 | 13 |
14 | @csrf 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @error('password') 23 | 24 | {{ $message }} 25 | 26 | @enderror 27 |
28 |
29 | 30 |
31 |
32 | 35 | 36 | @if (Route::has('password.request')) 37 | 38 | {{ __('Forgot Your Password?') }} 39 | 40 | @endif 41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | @endsection 50 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | 'auth'], function () { 14 | Route::get('/dashboard', [DashboardController::class, 'index'])->name('dash'); 15 | Route::get('/leads', [LeadController::class, 'index']); 16 | Route::get('/leads/list', [LeadController::class, 'index'])->name('lead.list'); 17 | 18 | Route::get('/leads/add', [LeadController::class, 'create'])->name('lead.add'); 19 | Route::post('/leads/save', [LeadController::class, 'store']); 20 | 21 | Route::get('/leads/view/{lead}', [LeadController::class, 'view'])->name('lead.view'); 22 | Route::post('/leads/update', [LeadController::class, 'update'])->name('lead.update'); 23 | 24 | Route::get('/leads/view/{lead}/reminder/add', [ReminderController::class, 'add'])->name('reminder.add'); 25 | Route::get('/leads/view/{lead}/reminder/{reminder}/view', [ReminderController::class, 'view'])->name('reminder.view'); 26 | Route::post('/leads/view/reminder/save', [ReminderController::class, 'store'])->name('reminder.save'); 27 | Route::post('/leads/view/reminder/update', [ReminderController::class, 'updateAndCreate'])->name('reminder.update'); 28 | 29 | Route::get('/leads/subscribe/{lead}', [LeadSubscriberController::class, 'view'])->name('lead.subscribe'); 30 | Route::post('/leads/subscribe/save', [LeadSubscriberController::class, 'store'])->name('lead.subscribe.add'); 31 | 32 | Route::get('/pacakges/list', [PackageController::class, 'index'])->name('package.list'); 33 | Route::post('/packages/save', [PackageController::class, 'store'])->name('package.save'); 34 | Route::get('/pacakges/view/{package}', [PackageController::class, 'view'])->name('package.view'); 35 | Route::post('/pacakges/update', [PackageController::class, 'update'])->name('package.update'); 36 | 37 | Route::get('/subscribers/list', [SubscriberController::class, 'index'])->name('subscribers.list'); 38 | }); 39 | 40 | Auth::routes(); 41 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3" 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 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | ], 66 | 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/js/Pages/Leads/ReminderNote.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 69 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 41 | } 42 | 43 | public function showRegistrationForm() 44 | { 45 | abort(404, 'The page you are looking for is not present.'); 46 | } 47 | 48 | public function register(Request $request) 49 | { 50 | abort(400, 'This request cannot be processed.'); 51 | } 52 | 53 | /** 54 | * Get a validator for an incoming registration request. 55 | * 56 | * @param array $data 57 | * @return \Illuminate\Contracts\Validation\Validator 58 | */ 59 | protected function validator(array $data) 60 | { 61 | return Validator::make($data, [ 62 | 'name' => ['required', 'string', 'max:255'], 63 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 64 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 65 | ]); 66 | } 67 | 68 | /** 69 | * Create a new user instance after a valid registration. 70 | * 71 | * @param array $data 72 | * @return \App\User 73 | */ 74 | protected function create(array $data) 75 | { 76 | return User::create([ 77 | 'name' => $data['name'], 78 | 'email' => $data['email'], 79 | 'password' => Hash::make($data['password']), 80 | ]); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /resources/js/Pages/Subscribers/SubsriberForm.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 88 | -------------------------------------------------------------------------------- /resources/js/Pages/Leads/Index.vue: -------------------------------------------------------------------------------- 1 | 68 | 69 | 80 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 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 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | 'block_for' => 0, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => env('AWS_ACCESS_KEY_ID'), 55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 58 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 59 | ], 60 | 61 | 'redis' => [ 62 | 'driver' => 'redis', 63 | 'connection' => 'default', 64 | 'queue' => env('REDIS_QUEUE', 'default'), 65 | 'retry_after' => 90, 66 | 'block_for' => null, 67 | ], 68 | 69 | ], 70 | 71 | /* 72 | |-------------------------------------------------------------------------- 73 | | Failed Queue Jobs 74 | |-------------------------------------------------------------------------- 75 | | 76 | | These options configure the behavior of failed queue job logging so you 77 | | can control which database and table are used to store the jobs that 78 | | have failed. You may change them to any database / table you wish. 79 | | 80 | */ 81 | 82 | 'failed' => [ 83 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), 84 | 'database' => env('DB_CONNECTION', 'mysql'), 85 | 'table' => 'failed_jobs', 86 | ], 87 | 88 | ]; 89 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel 8 | 9 | 10 | 11 | 12 | 13 | 65 | 66 | 67 |
68 | @if (Route::has('login')) 69 | 76 | @endif 77 | 78 |
79 |
80 | Laravel 81 |
82 | 83 | 93 |
94 |
95 | 96 | 97 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @error('email') 23 | 24 | {{ $message }} 25 | 26 | @enderror 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @error('password') 37 | 38 | {{ $message }} 39 | 40 | @enderror 41 |
42 |
43 | 44 |
45 | 46 | 47 |
48 | 49 |
50 |
51 | 52 |
53 |
54 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | @endsection 66 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 31 | \App\Http\Middleware\EncryptCookies::class, 32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 33 | \Illuminate\Session\Middleware\StartSession::class, 34 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 36 | \App\Http\Middleware\VerifyCsrfToken::class, 37 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 38 | ], 39 | 40 | 'api' => [ 41 | 'throttle:60,1', 42 | 'bindings', 43 | ], 44 | ]; 45 | 46 | /** 47 | * The application's route middleware. 48 | * 49 | * These middleware may be assigned to groups or used individually. 50 | * 51 | * @var array 52 | */ 53 | protected $routeMiddleware = [ 54 | 'auth' => \App\Http\Middleware\Authenticate::class, 55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 57 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 58 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 59 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 60 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 61 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 62 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 63 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 64 | ]; 65 | 66 | /** 67 | * The priority-sorted list of middleware. 68 | * 69 | * This forces non-global middleware to always be in the given order. 70 | * 71 | * @var array 72 | */ 73 | protected $middlewarePriority = [ 74 | \Illuminate\Session\Middleware\StartSession::class, 75 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 76 | \App\Http\Middleware\Authenticate::class, 77 | \Illuminate\Routing\Middleware\ThrottleRequests::class, 78 | \Illuminate\Session\Middleware\AuthenticateSession::class, 79 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 80 | \Illuminate\Auth\Middleware\Authorize::class, 81 | ]; 82 | } 83 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Log Channels 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Here you may configure the log channels for your application. Out of 28 | | the box, Laravel uses the Monolog PHP logging library. This gives 29 | | you a variety of powerful log handlers / formatters to utilize. 30 | | 31 | | Available Drivers: "single", "daily", "slack", "syslog", 32 | | "errorlog", "monolog", 33 | | "custom", "stack" 34 | | 35 | */ 36 | 37 | 'channels' => [ 38 | 'stack' => [ 39 | 'driver' => 'stack', 40 | 'channels' => ['daily'], 41 | 'ignore_exceptions' => false, 42 | ], 43 | 44 | 'single' => [ 45 | 'driver' => 'single', 46 | 'path' => storage_path('logs/laravel.log'), 47 | 'level' => 'debug', 48 | ], 49 | 50 | 'daily' => [ 51 | 'driver' => 'daily', 52 | 'path' => storage_path('logs/laravel.log'), 53 | 'level' => 'debug', 54 | 'days' => 14, 55 | ], 56 | 57 | 'slack' => [ 58 | 'driver' => 'slack', 59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 60 | 'username' => 'Laravel Log', 61 | 'emoji' => ':boom:', 62 | 'level' => 'critical', 63 | ], 64 | 65 | 'papertrail' => [ 66 | 'driver' => 'monolog', 67 | 'level' => 'debug', 68 | 'handler' => SyslogUdpHandler::class, 69 | 'handler_with' => [ 70 | 'host' => env('PAPERTRAIL_URL'), 71 | 'port' => env('PAPERTRAIL_PORT'), 72 | ], 73 | ], 74 | 75 | 'stderr' => [ 76 | 'driver' => 'monolog', 77 | 'handler' => StreamHandler::class, 78 | 'formatter' => env('LOG_STDERR_FORMATTER'), 79 | 'with' => [ 80 | 'stream' => 'php://stderr', 81 | ], 82 | ], 83 | 84 | 'syslog' => [ 85 | 'driver' => 'syslog', 86 | 'level' => 'debug', 87 | ], 88 | 89 | 'errorlog' => [ 90 | 'driver' => 'errorlog', 91 | 'level' => 'debug', 92 | ], 93 | 94 | 'null' => [ 95 | 'driver' => 'monolog', 96 | 'handler' => NullHandler::class, 97 | ], 98 | ], 99 | 100 | ]; 101 | -------------------------------------------------------------------------------- /resources/js/Shared/Layout.vue: -------------------------------------------------------------------------------- 1 | 76 | 77 | 100 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ config('app.name', 'Laravel') }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 69 | 70 |
71 | @yield('content') 72 |
73 |
74 | 75 | 76 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Cache Stores 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may define all of the cache "stores" for your application as 29 | | well as their drivers. You may even define multiple stores for the 30 | | same cache driver to group types of items stored in your caches. 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | ], 43 | 44 | 'database' => [ 45 | 'driver' => 'database', 46 | 'table' => 'cache', 47 | 'connection' => null, 48 | ], 49 | 50 | 'file' => [ 51 | 'driver' => 'file', 52 | 'path' => storage_path('framework/cache/data'), 53 | ], 54 | 55 | 'memcached' => [ 56 | 'driver' => 'memcached', 57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 58 | 'sasl' => [ 59 | env('MEMCACHED_USERNAME'), 60 | env('MEMCACHED_PASSWORD'), 61 | ], 62 | 'options' => [ 63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 64 | ], 65 | 'servers' => [ 66 | [ 67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 68 | 'port' => env('MEMCACHED_PORT', 11211), 69 | 'weight' => 100, 70 | ], 71 | ], 72 | ], 73 | 74 | 'redis' => [ 75 | 'driver' => 'redis', 76 | 'connection' => 'cache', 77 | ], 78 | 79 | 'dynamodb' => [ 80 | 'driver' => 'dynamodb', 81 | 'key' => env('AWS_ACCESS_KEY_ID'), 82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 85 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 86 | ], 87 | 88 | ], 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Cache Key Prefix 93 | |-------------------------------------------------------------------------- 94 | | 95 | | When utilizing a RAM based store such as APC or Memcached, there might 96 | | be other applications utilizing the same cache. So, we'll specify a 97 | | value to get prefixed to all our keys so we can avoid collisions. 98 | | 99 | */ 100 | 101 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 102 | 103 | ]; 104 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Login') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('email') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('password') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 50 |
51 |
52 |
53 | 54 |
55 |
56 | 59 | 60 | @if (Route::has('password.request')) 61 | 62 | {{ __('Forgot Your Password?') }} 63 | 64 | @endif 65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | @endsection 74 | -------------------------------------------------------------------------------- /resources/js/Pages/Leads/LeadView.vue: -------------------------------------------------------------------------------- 1 | 75 | 76 | 109 | -------------------------------------------------------------------------------- /resources/js/Pages/Leads/ReminderView.vue: -------------------------------------------------------------------------------- 1 | 63 | 64 | 121 | -------------------------------------------------------------------------------- /resources/js/Shared/LeadForm.vue: -------------------------------------------------------------------------------- 1 | 97 | 98 | 130 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Register') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('name') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('email') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | @error('password') 49 | 50 | {{ $message }} 51 | 52 | @enderror 53 |
54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @endsection 78 | -------------------------------------------------------------------------------- /app/Http/Controllers/LeadController.php: -------------------------------------------------------------------------------- 1 | validations = [ 19 | 'name' => 'required', 20 | 'email' => 'required|email', 21 | 'dob' => 'required|date', 22 | 'phone' => 'required', 23 | 'interested_package' => 'sometimes', 24 | ]; 25 | } 26 | 27 | public function index(Request $request) 28 | { 29 | $package = null; 30 | $search = false; 31 | if ($request->has('package_search') && $request->input('package_search') != 0) { 32 | $package = Package::findOrFail($request->input('package_search')); 33 | } 34 | if ($request->has('search') && $request->input('search') !== '') { 35 | $search = true; 36 | } 37 | 38 | $leads = Lead::query() 39 | ->where('branch_id', 1) 40 | ->where('active', 1) 41 | ->when($search, function ($query) use ($request) { 42 | $query->where('name', 'like', "%{$request->input('search')}%") 43 | ->orWhere('email', 'like', "%{$request->input('search')}%"); 44 | }) 45 | ->when($package !== null, function ($query) use ($request, $package) { 46 | $query->where('interested_package', '=', $package->name); 47 | }) 48 | ->orderByDesc('id') 49 | ->paginate(10); 50 | 51 | return Inertia::render('Leads/Index', [ 52 | 'leads' => $leads, 53 | ]); 54 | } 55 | 56 | public function create() 57 | { 58 | $packages = Package::query() 59 | ->where('status', 'active') 60 | ->orderByDesc('id') 61 | ->get(); 62 | 63 | return Inertia::render('Leads/LeadAdd', [ 64 | 'packages' => $packages, 65 | ]); 66 | } 67 | 68 | public function store(Request $request) 69 | { 70 | $postData = $this->validate($request, $this->validations); 71 | 72 | $package = ""; 73 | if ($request->has('interested_package')) { 74 | $package = $request->input('interested_package'); 75 | } 76 | 77 | $dob = Carbon::parse($postData['dob']); 78 | $age = $dob->age; 79 | 80 | Lead::create([ 81 | 'name' => $postData['name'], 82 | 'email' => $postData['email'], 83 | 'dob' => $dob, 84 | 'phone' => $postData['phone'], 85 | 'branch_id' => 1, 86 | 'age' => $age, 87 | 'added_by' => Auth::user()->id, 88 | 'interested_package' => $package, 89 | ]); 90 | 91 | return redirect()->route('lead.list'); 92 | } 93 | 94 | public function view(Lead $lead) 95 | { 96 | $lead->load(['reminders']); 97 | 98 | $packages = Package::query() 99 | ->where('status', 'active') 100 | ->orderByDesc('id') 101 | ->get(); 102 | 103 | return Inertia::render('Leads/LeadView', [ 104 | 'lead-prop' => $lead, 105 | 'packages' => $packages, 106 | ]); 107 | } 108 | 109 | public function update(Request $request) 110 | { 111 | $rules = $this->validations; 112 | $rules['id'] = 'required|exists:leads'; 113 | 114 | $postData = $this->validate($request, $rules); 115 | $postData['age'] = Carbon::parse($postData['dob'])->age; 116 | 117 | $lead = Lead::where('id', $postData['id']) 118 | ->update($postData); 119 | 120 | return redirect() 121 | ->route('lead.view', ['lead' => $postData['id']]) 122 | ->with('success', 'Your chages are saved now.'); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /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 | 'hash' => false, 48 | ], 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | User Providers 54 | |-------------------------------------------------------------------------- 55 | | 56 | | All authentication drivers have a user provider. This defines how the 57 | | users are actually retrieved out of your database or other storage 58 | | mechanisms used by this application to persist your user's data. 59 | | 60 | | If you have multiple user tables or models you may configure multiple 61 | | sources which represent each model / table. These sources may then 62 | | be assigned to any extra authentication guards you have defined. 63 | | 64 | | Supported: "database", "eloquent" 65 | | 66 | */ 67 | 68 | 'providers' => [ 69 | 'users' => [ 70 | 'driver' => 'eloquent', 71 | 'model' => App\User::class, 72 | ], 73 | 74 | // 'users' => [ 75 | // 'driver' => 'database', 76 | // 'table' => 'users', 77 | // ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Resetting Passwords 83 | |-------------------------------------------------------------------------- 84 | | 85 | | You may specify multiple password reset configurations if you have more 86 | | than one user table or model in the application and you want to have 87 | | separate password reset settings based on the specific user types. 88 | | 89 | | The expire time is the number of minutes that the reset token should be 90 | | considered valid. This security feature keeps tokens short-lived so 91 | | they have less time to be guessed. You may change this as needed. 92 | | 93 | */ 94 | 95 | 'passwords' => [ 96 | 'users' => [ 97 | 'provider' => 'users', 98 | 'table' => 'password_resets', 99 | 'expire' => 60, 100 | ], 101 | ], 102 | 103 | /* 104 | |-------------------------------------------------------------------------- 105 | | Password Confirmation Timeout 106 | |-------------------------------------------------------------------------- 107 | | 108 | | Here you may define the amount of seconds before a password confirmation 109 | | times out and the user is prompted to re-enter their password via the 110 | | confirmation screen. By default, the timeout lasts for three hours. 111 | | 112 | */ 113 | 114 | 'password_timeout' => 10800, 115 | 116 | ]; 117 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | Build Status 5 | Total Downloads 6 | Latest Stable Version 7 | License 8 |

9 | 10 | ## About Laravel 11 | 12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: 13 | 14 | - [Simple, fast routing engine](https://laravel.com/docs/routing). 15 | - [Powerful dependency injection container](https://laravel.com/docs/container). 16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. 17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). 18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations). 19 | - [Robust background job processing](https://laravel.com/docs/queues). 20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting). 21 | 22 | Laravel is accessible, powerful, and provides tools required for large, robust applications. 23 | 24 | ## Learning Laravel 25 | 26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. 27 | 28 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. 29 | 30 | ## Laravel Sponsors 31 | 32 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). 33 | 34 | - **[Vehikl](https://vehikl.com/)** 35 | - **[Tighten Co.](https://tighten.co)** 36 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** 37 | - **[64 Robots](https://64robots.com)** 38 | - **[Cubet Techno Labs](https://cubettech.com)** 39 | - **[Cyber-Duck](https://cyber-duck.co.uk)** 40 | - **[British Software Development](https://www.britishsoftware.co)** 41 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** 42 | - **[DevSquad](https://devsquad.com)** 43 | - [UserInsights](https://userinsights.com) 44 | - [Fragrantica](https://www.fragrantica.com) 45 | - [SOFTonSOFA](https://softonsofa.com/) 46 | - [User10](https://user10.com) 47 | - [Soumettre.fr](https://soumettre.fr/) 48 | - [CodeBrisk](https://codebrisk.com) 49 | - [1Forge](https://1forge.com) 50 | - [TECPRESSO](https://tecpresso.co.jp/) 51 | - [Runtime Converter](http://runtimeconverter.com/) 52 | - [WebL'Agence](https://weblagence.com/) 53 | - [Invoice Ninja](https://www.invoiceninja.com) 54 | - [iMi digital](https://www.imi-digital.de/) 55 | - [Earthlink](https://www.earthlink.ro/) 56 | - [Steadfast Collective](https://steadfastcollective.com/) 57 | - [We Are The Robots Inc.](https://watr.mx/) 58 | - [Understand.io](https://www.understand.io/) 59 | - [Abdel Elrafa](https://abdelelrafa.com) 60 | - [Hyper Host](https://hyper.host) 61 | - [Appoly](https://www.appoly.co.uk) 62 | - [OP.GG](https://op.gg) 63 | 64 | ## Contributing 65 | 66 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). 67 | 68 | ## Security Vulnerabilities 69 | 70 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. 71 | 72 | ## License 73 | 74 | The Laravel framework is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT). 75 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | registerLengthAwarePaginator(); 24 | } 25 | 26 | /** 27 | * Bootstrap any application services. 28 | * 29 | * @return void 30 | */ 31 | public function boot() 32 | { 33 | Inertia::share('flash', function() { 34 | return [ 35 | 'message' => Session::get('message'), 36 | 'success' => Session::get('success'), 37 | 'error' => Session::get('error'), 38 | ]; 39 | }); 40 | 41 | Inertia::share([ 42 | 'errors' => function () { 43 | return Session::get('errors') 44 | ? Session::get('errors')->getBag('default')->getMessages() 45 | : (object) []; 46 | }, 47 | ]); 48 | 49 | Inertia::share('auth.user', function () { 50 | if (Auth::user()) { 51 | return [ 52 | 'id' => Auth::user()->id, 53 | 'name' => Auth::user()->name, 54 | ]; 55 | } 56 | }); 57 | } 58 | 59 | private function registerLengthAwarePaginator() 60 | { 61 | $this->app->bind(LengthAwarePaginator::class, function ($app, $values) { 62 | return new class(...array_values($values)) extends LengthAwarePaginator { 63 | public function only(...$attributes) 64 | { 65 | return $this->transform(function ($item) use ($attributes) { 66 | return $item->only($attributes); 67 | }); 68 | } 69 | public function transform($callback) 70 | { 71 | $this->items->transform($callback); 72 | return $this; 73 | } 74 | public function toArray() 75 | { 76 | return [ 77 | 'data' => $this->items->toArray(), 78 | 'links' => $this->links(), 79 | ]; 80 | } 81 | public function links($view = null, $data = []) 82 | { 83 | $this->appends(Request::all()); 84 | $window = UrlWindow::make($this); 85 | $elements = array_filter([ 86 | $window['first'], 87 | is_array($window['slider']) ? '...' : null, 88 | $window['slider'], 89 | is_array($window['last']) ? '...' : null, 90 | $window['last'], 91 | ]); 92 | return Collection::make($elements)->flatMap(function ($item) { 93 | if (is_array($item)) { 94 | return Collection::make($item)->map(function ($url, $page) { 95 | return [ 96 | 'url' => $url, 97 | 'label' => $page, 98 | 'active' => $this->currentPage() === $page, 99 | ]; 100 | }); 101 | } else { 102 | return [ 103 | [ 104 | 'url' => null, 105 | 'label' => '...', 106 | 'active' => false, 107 | ], 108 | ]; 109 | } 110 | })->prepend([ 111 | 'url' => $this->previousPageUrl(), 112 | 'label' => 'Previous', 113 | 'active' => false, 114 | ])->push([ 115 | 'url' => $this->nextPageUrl(), 116 | 'label' => 'Next', 117 | 'active' => false, 118 | ]); 119 | } 120 | }; 121 | }); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /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' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | /* 124 | |-------------------------------------------------------------------------- 125 | | Log Channel 126 | |-------------------------------------------------------------------------- 127 | | 128 | | If you are using the "log" driver, you may specify the logging channel 129 | | if you prefer to keep mail messages separate from other log entries 130 | | for simpler reading. Otherwise, the default channel will be used. 131 | | 132 | */ 133 | 134 | 'log_channel' => env('MAIL_LOG_CHANNEL'), 135 | 136 | ]; 137 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', '127.0.0.1'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'forge'), 52 | 'username' => env('DB_USERNAME', 'forge'), 53 | 'password' => env('DB_PASSWORD', ''), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'schema' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | ], 93 | 94 | ], 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Migration Repository Table 99 | |-------------------------------------------------------------------------- 100 | | 101 | | This table keeps track of all the migrations that have already run for 102 | | your application. Using this information, we can determine which of 103 | | the migrations on disk haven't actually been run in the database. 104 | | 105 | */ 106 | 107 | 'migrations' => 'migrations', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Redis Databases 112 | |-------------------------------------------------------------------------- 113 | | 114 | | Redis is an open source, fast, and advanced key-value store that also 115 | | provides a richer body of commands than a typical key-value system 116 | | such as APC or Memcached. Laravel makes it easy to dig right in. 117 | | 118 | */ 119 | 120 | 'redis' => [ 121 | 122 | 'client' => env('REDIS_CLIENT', 'phpredis'), 123 | 124 | 'options' => [ 125 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 126 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 127 | ], 128 | 129 | 'default' => [ 130 | 'url' => env('REDIS_URL'), 131 | 'host' => env('REDIS_HOST', '127.0.0.1'), 132 | 'password' => env('REDIS_PASSWORD', null), 133 | 'port' => env('REDIS_PORT', 6379), 134 | 'database' => env('REDIS_DB', 0), 135 | ], 136 | 137 | 'cache' => [ 138 | 'url' => env('REDIS_URL'), 139 | 'host' => env('REDIS_HOST', '127.0.0.1'), 140 | 'password' => env('REDIS_PASSWORD', null), 141 | 'port' => env('REDIS_PORT', 6379), 142 | 'database' => env('REDIS_CACHE_DB', 1), 143 | ], 144 | 145 | ], 146 | 147 | ]; 148 | -------------------------------------------------------------------------------- /.idea/php.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to immediately expire on the browser closing, set that option. 31 | | 32 | */ 33 | 34 | 'lifetime' => env('SESSION_LIFETIME', 120), 35 | 36 | 'expire_on_close' => false, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Session Encryption 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This option allows you to easily specify that all of your session data 44 | | should be encrypted before it is stored. All encryption will be run 45 | | automatically by Laravel and you can use the Session like normal. 46 | | 47 | */ 48 | 49 | 'encrypt' => false, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Session File Location 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When using the native session driver, we need a location where session 57 | | files may be stored. A default has been set for you but a different 58 | | location may be specified. This is only needed for file sessions. 59 | | 60 | */ 61 | 62 | 'files' => storage_path('framework/sessions'), 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Session Database Connection 67 | |-------------------------------------------------------------------------- 68 | | 69 | | When using the "database" or "redis" session drivers, you may specify a 70 | | connection that should be used to manage these sessions. This should 71 | | correspond to a connection in your database configuration options. 72 | | 73 | */ 74 | 75 | 'connection' => env('SESSION_CONNECTION', null), 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Session Database Table 80 | |-------------------------------------------------------------------------- 81 | | 82 | | When using the "database" session driver, you may specify the table we 83 | | should use to manage the sessions. Of course, a sensible default is 84 | | provided for you; however, you are free to change this as needed. 85 | | 86 | */ 87 | 88 | 'table' => 'sessions', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Session Cache Store 93 | |-------------------------------------------------------------------------- 94 | | 95 | | When using the "apc", "memcached", or "dynamodb" session drivers you may 96 | | list a cache store that should be used for these sessions. This value 97 | | must match with one of the application's configured cache "stores". 98 | | 99 | */ 100 | 101 | 'store' => env('SESSION_STORE', null), 102 | 103 | /* 104 | |-------------------------------------------------------------------------- 105 | | Session Sweeping Lottery 106 | |-------------------------------------------------------------------------- 107 | | 108 | | Some session drivers must manually sweep their storage location to get 109 | | rid of old sessions from storage. Here are the chances that it will 110 | | happen on a given request. By default, the odds are 2 out of 100. 111 | | 112 | */ 113 | 114 | 'lottery' => [2, 100], 115 | 116 | /* 117 | |-------------------------------------------------------------------------- 118 | | Session Cookie Name 119 | |-------------------------------------------------------------------------- 120 | | 121 | | Here you may change the name of the cookie used to identify a session 122 | | instance by ID. The name specified here will get used every time a 123 | | new session cookie is created by the framework for every driver. 124 | | 125 | */ 126 | 127 | 'cookie' => env( 128 | 'SESSION_COOKIE', 129 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 130 | ), 131 | 132 | /* 133 | |-------------------------------------------------------------------------- 134 | | Session Cookie Path 135 | |-------------------------------------------------------------------------- 136 | | 137 | | The session cookie path determines the path for which the cookie will 138 | | be regarded as available. Typically, this will be the root path of 139 | | your application but you are free to change this when necessary. 140 | | 141 | */ 142 | 143 | 'path' => '/', 144 | 145 | /* 146 | |-------------------------------------------------------------------------- 147 | | Session Cookie Domain 148 | |-------------------------------------------------------------------------- 149 | | 150 | | Here you may change the domain of the cookie used to identify a session 151 | | in your application. This will determine which domains the cookie is 152 | | available to in your application. A sensible default has been set. 153 | | 154 | */ 155 | 156 | 'domain' => env('SESSION_DOMAIN', null), 157 | 158 | /* 159 | |-------------------------------------------------------------------------- 160 | | HTTPS Only Cookies 161 | |-------------------------------------------------------------------------- 162 | | 163 | | By setting this option to true, session cookies will only be sent back 164 | | to the server if the browser has a HTTPS connection. This will keep 165 | | the cookie from being sent to you if it can not be done securely. 166 | | 167 | */ 168 | 169 | 'secure' => env('SESSION_SECURE_COOKIE', false), 170 | 171 | /* 172 | |-------------------------------------------------------------------------- 173 | | HTTP Access Only 174 | |-------------------------------------------------------------------------- 175 | | 176 | | Setting this value to true will prevent JavaScript from accessing the 177 | | value of the cookie and the cookie will only be accessible through 178 | | the HTTP protocol. You are free to modify this option if needed. 179 | | 180 | */ 181 | 182 | 'http_only' => true, 183 | 184 | /* 185 | |-------------------------------------------------------------------------- 186 | | Same-Site Cookies 187 | |-------------------------------------------------------------------------- 188 | | 189 | | This option determines how your cookies behave when cross-site requests 190 | | take place, and can be used to mitigate CSRF attacks. By default, we 191 | | do not enable this as other CSRF protection services are in place. 192 | | 193 | | Supported: "lax", "strict" 194 | | 195 | */ 196 | 197 | 'same_site' => null, 198 | 199 | ]; 200 | -------------------------------------------------------------------------------- /.idea/FitnessForce.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | --------------------------------------------------------------------------------