File: /home/durgeshpandey215/www/kanaksoftware.skilladders.com/routes/api.php
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\NewsController;
use App\Http\Controllers\UserProfileController;
use App\Http\Controllers\ClientController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\CategoryController;
use Illuminate\Support\Facades\Artisan;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::post('login', [AuthController::class, 'login']);
Route::post('login-with-mobile', [AuthController::class, 'loginWithMobile'])->name('login');
Route::get('invalid-login', Function(){
return response()->json(['status' => "Unauthorized", "code"=>401, 'error' => 'Token expired']);
})->name('api.invalid-login');
Route::get('invalid-login', Function(){
return response()->json(['status' => "Unauthorized", "code"=>401, 'error' => 'Token expired']);
})->name('invalid.login');
Route::get('/validate-token', [AuthController::class, 'validateToken']);
Route::post('/forgot-password', [UserProfileController::class, 'forgotPassword'])->name('password.forgot');
Route::post('/forgot-password', [UserProfileController::class, 'forgotPassword'])->name('emails.password_reset');
Route::post('/reset-password', [UserProfileController::class, 'resetPassword'])->name('password.reset');
Route::get('/reset-password/redirect', [UserProfileController::class, 'resetPasswordRedirect'])->name('password.reset.redirect');
Route::get('homepage', [HomeController::class, 'index'])->name('home');
Route::get('imp-dates', [HomeController::class, 'getImpDates'])->name('home.date');
Route::get('content/{news_type}', [NewsController::class, 'index'])->name('news');
Route::get('content/{news_type}/search/{str}', [NewsController::class, 'search'])->name('news.search');
Route::get('products', [ProductController::class, 'getProductList'])->name('product');
Route::get('{news_type}/detail/{seo_url}', [NewsController::class, 'detail'])->name('news.detail');
Route::get('menu-list', [HomeController::class, 'menuList'])->name('menu.list');
Route::middleware('auth:api')->group(function () {
Route::post('logout', [AuthController::class, 'logout'])->name('users.logout');
Route::get('refresh', [AuthController::class, 'refresh'])->name('users.refresh.token');
Route::get('user-profile', [UserProfileController::class, 'getUserProfile']);
Route::post('user-profile/update', [UserProfileController::class, 'updateUserProfile']);
Route::post('/change-password', [UserProfileController::class, 'changePassword'])->name('users.change_password');
Route::post('/add-client', [ClientController::class, 'addClient']);
Route::get('product/{seo_url}', [ProductController::class, 'productDetail'])->name('product.list');
Route::get('category/{category}/{seo_url}', [CategoryController::class, 'index'])->name('category.list');
Route::post('category/{category}/{seo_url}/{content_category_id}', [CategoryController::class, 'ajaxContentListing'])->name('category.content');
Route::post('search/{seo_url}', [CategoryController::class, 'searchResults'])->name('search');
Route::post('search/{seo_url}/{category_id}', [CategoryController::class, 'searchResultsById'])->name('search.category_id');
Route::get('/content/mail/{id}', [CategoryController::class, 'mailContentInfo'])->name('content.mail');
Route::get('/content/mail/{id}/{type}', [CategoryController::class, 'mailContentInfo'])->name('content.mail');
});
Route::post('content/info/{seo_url}/{content_id}', [CategoryController::class, 'contentDetail'])->name('content.info');
Route::post('news-letter/post', [HomeController::class, 'postNewsletter'])->name('newletter.store');
Route::get('user-testimonial/getactive', [HomeController::class, 'getAllActiveTestimonial'])->name('testimonial.active');
Route::post('feedback/store', [HomeController::class, 'storeFeedback'])->name('feedback.store');
Route::post('publish/your-article', [HomeController::class, 'publishArticle'])->name('publish.article');
Route::get('/content/pdf/{id}', [HomeController::class, 'pdfCcontentById'])->name('content.pdf');
Route::get('/content/word/{id}', [CategoryController::class, 'downloadWord'])->name('content.word');
Route::post('search', [ProductController::class, 'smartSearch'])->name('search');
Route::get('/clear-cache', function () {
Artisan::call('optimize:clear');
return "Cache cleared successfully!";
});