<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Artisan;
use App\Http\Controllers\StripePaymentController;
use App\Models\Plan;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/', function () {
    dd(Carbon\Carbon::now()->addYears()->toDateTimeString(), Carbon\Carbon::now()->addDays()->toDateTimeString());
    $get_plan = Plan::get();
    return view('welcome', compact('get_plan'));
});


Route::post('/createcustomer', [StripePaymentController::class, 'create_customers'])->name('create_customer');

Route::get('/subscriptionpage', [StripePaymentController::class, 'subscription_page'])->name('subscriptionpage');

Route::get('/clear', function () {
    Artisan::call('cache:clear');
    Artisan::call('config:clear');
    Artisan::call('config:cache');
    Artisan::call('view:clear');

    return "Cleared!";
});
Route::get('/storage', function () {
    Artisan::call('storage:link');
    return "linked!";
});
Route::get('/migrate', function () {
    Artisan::call('migrate');
    return "Migrated!";
});
Route::get('/migrate/fresh', function () {
    Artisan::call('migrate:fresh --seed');
    return "Migrated!";
});
