Skip to content

Commit

Permalink
Merge branch 'mla/resource-page' of https://github.com/tighten/onramp
Browse files Browse the repository at this point in the history
…into mla/resource-page
  • Loading branch information
MarcyLina committed Nov 8, 2024
2 parents e59eafa + cd795dc commit cff0021
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ f726790a2e2c09018532c8e7397359d443b63e70
0fae228289851aea2d79b09b546dcf5f7f852446
bf119c7c9689569a03c527696008eadd5ad5a29c
9a00c3e9425e213ceca32b57b14dad1f785f99ae
05a012b4674406492f24984bc3eab34b0371cdef
21 changes: 10 additions & 11 deletions app/Http/Controllers/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@

use App\Models\Resource;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\View\View;

class ResourceController extends Controller
{
public function index(): View
{
$resources = Resource::where('created_at', '>=', Carbon::now()->subDays(30))
->with('modules') // Eager load the module relationship
->get();
public function index(): View
{
$resources = Resource::where('created_at', '>=', Carbon::now()->subDays(30))
->with('modules') // Eager load the module relationship
->get();

return view('new-resources', [
'pageTitle' => __('New Resources'),
'resources' => $resources,
]);
}
return view('new-resources', [
'pageTitle' => __('New Resources'),
'resources' => $resources,
]);
}
}
66 changes: 33 additions & 33 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@
Route::get('/', RootRedirectController::class);

Route::prefix('{locale}')->group(function () {
Route::view('/', 'welcome')->name('welcome');

Route::view('use-of-data', 'use-of-data')->name('use-of-data');
Route::get('glossary', [GlossaryController::class, 'index'])->name('glossary');
Route::get('tracks', [TrackController::class, 'index'])->name('tracks');

Route::prefix('modules')->name('modules.')->group(function () {
Route::get('/', [ModuleController::class, 'index'])->name('index');
Route::get('{module}/{resourceType}', [ModuleController::class, 'show'])
->name('show')
->where('resourceType', 'free-resources|paid-resources|quizzes|exercises');
});

Route::middleware('auth')->group(function () {
Route::get('wizard', [WizardController::class, 'index'])->name('wizard.index');
Route::post('wizard', [WizardController::class, 'store'])->name('wizard.store');
Route::get('profile', [ProfileController::class, 'show'])->name('user.profile.show');
Route::put('profile', [ProfileController::class, 'update'])->name('user.profile.update');
Route::get('preferences', [PreferenceController::class, 'index'])->name('user.preferences.index');
Route::post('completions', [CompletionsController::class, 'store'])->name('user.completions.store');
Route::delete('completions', [CompletionsController::class, 'destroy'])->name('user.completions.destroy');
Route::patch('preferences', [PreferenceController::class, 'update'])->name('user.preferences.update');
Route::get('new-resources', [ResourceController::class, 'index'])->name('user.new-resources');
});

Route::get('unsubscribe/{token}', [SubscriptionController::class, 'destroy'])->name('unsubscribe');

Auth::routes(['register' => false]);

Route::prefix('login')->group(function () {
Route::get('github', [LoginController::class, 'redirectToProvider'])->name('login.github');
Route::get('github/callback', [LoginController::class, 'handleProviderCallback']);
});
Route::view('/', 'welcome')->name('welcome');

Route::view('use-of-data', 'use-of-data')->name('use-of-data');
Route::get('glossary', [GlossaryController::class, 'index'])->name('glossary');
Route::get('tracks', [TrackController::class, 'index'])->name('tracks');

Route::prefix('modules')->name('modules.')->group(function () {
Route::get('/', [ModuleController::class, 'index'])->name('index');
Route::get('{module}/{resourceType}', [ModuleController::class, 'show'])
->name('show')
->where('resourceType', 'free-resources|paid-resources|quizzes|exercises');
});

Route::middleware('auth')->group(function () {
Route::get('wizard', [WizardController::class, 'index'])->name('wizard.index');
Route::post('wizard', [WizardController::class, 'store'])->name('wizard.store');
Route::get('profile', [ProfileController::class, 'show'])->name('user.profile.show');
Route::put('profile', [ProfileController::class, 'update'])->name('user.profile.update');
Route::get('preferences', [PreferenceController::class, 'index'])->name('user.preferences.index');
Route::post('completions', [CompletionsController::class, 'store'])->name('user.completions.store');
Route::delete('completions', [CompletionsController::class, 'destroy'])->name('user.completions.destroy');
Route::patch('preferences', [PreferenceController::class, 'update'])->name('user.preferences.update');
Route::get('new-resources', [ResourceController::class, 'index'])->name('user.new-resources');
});

Route::get('unsubscribe/{token}', [SubscriptionController::class, 'destroy'])->name('unsubscribe');

Auth::routes(['register' => false]);

Route::prefix('login')->group(function () {
Route::get('github', [LoginController::class, 'redirectToProvider'])->name('login.github');
Route::get('github/callback', [LoginController::class, 'handleProviderCallback']);
});
});

0 comments on commit cff0021

Please sign in to comment.