1 year ago

Making a route public for anyone to view

Posted 1 year ago by Ap3twe

I want to allow a route to be public for anyone who has the URL to view. It is coming from protected routes from the admin. The admin creates the pages and the final page we would send it to a doctor who will also send it to the patients. How can I create a public URL from Route::get('/smiledesign/{project}/doctorfinalform', '[email protected]');

The view is like this http://blog.test/smiledesign/4/doctorfinalform

Here are my routes


// Users Routes
Route::get('/home', '[email protected]')->name('home');
Route::get('/smiledesign/create', '[email protected]');
Route::post('/store', '[email protected]');
Route::get('/smiledesign/{project}/show', '[email protected]');
Route::get('/smiledesign/success', '[email protected]');
Route::get('/smiledesign/cases', '[email protected]');

// Doctor final form
Route::get('/smiledesign/{project}/doctorfinalform', '[email protected]');

// Admin redirect to dashboard
Route::get('/admin', '[email protected]')->middleware('admin');

// Admin Routes
Route::middleware('forStaff')->group(function () {
Route::get('/smiledesign/adminforms', '[email protected]');
Route::get('/smiledesign/{project}/records', '[email protected]');
Route::patch('/smiledesign/{project}', '[email protected]');
Route::get('/smiledesign/{project}/edit', '[email protected]');
Route::delete('/smiledesign/{project}', '[email protected]');
Route::get('/smiledesign/{project}/userproject', '[email protected]');
Route::get('/smiledesign/published', '[email protected]');

 // Published page
    public function published(project $project){
        $project = Project::where('user_id', auth()->id())->find(session('created_id'));
        return view ('/smiledesign.published', compact('project'));


    public function doctorfinalform(Project $project, request $request){

        return view('smiledesign.doctorfinalform', compact('project'));

Please sign in or create an account to participate in this conversation.