ewa / routes /web.php
lisatthu35's picture
Update routes/web.php
2f6c20f verified
Raw
History Blame Contribute Delete
1.49 kB
<?php
use App\Services\ComicServices;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::get('/oauth/gmail', function (){
return LaravelGmail::redirect();
});
Route::get('/oauth2', function (){
LaravelGmail::makeToken();
return redirect()->to('/');
});
Route::get('/oauth/gmail/logout', function (){
LaravelGmail::logout(); //It returns exception if fails
return redirect()->to('/');
});
Route::post('/github-webhook', function () {
return "ok";
});
Route::get('/update-gmail', function () {
$giaTriX = request()->query('x');
$duongDanFile=base_path('public')."/"."gmail/tokens/gmail-json.json"; // Thay thế bằng đường dẫn thực tế đến file của bạn
$noiDung = 'Đây là nội dung chuỗi mà tôi muốn ghi vào file.';
try {
File::put($duongDanFile, $giaTriX);
echo 'Đã ghi thành công vào file.';
} catch (\Exception $e) {
echo 'Có lỗi xảy ra khi ghi file: ' . $e->getMessage();
}
})->name('test11');