Should Return to the Page Even Without Login in Laravel 5.4

Should Return to the Page Even Without Login in Laravel 5.4

I am working on laravel 5.4 project. I want to access some pages even without logged in but it always redirect to the login page. Here's my code. Is there anything i can do in middleware? Can you guys help me with this? i'm not really good in laravel. Thank you in advance guys.

I am working on laravel 5.4 project. I want to access some pages even without logged in but it always redirect to the login page. Here's my code. Is there anything i can do in middleware? Can you guys help me with this? i'm not really good in laravel. Thank you in advance guys.

Route

<?php

Route::get('/', function () { return view('pages.index'); });

Auth::routes();

Route::get('/home', '[email protected]')->name('home'); Route::get('/admin_dashboard', '[email protected]_dashboard'); Route::get('/admin_course_category', '[email protected]_course_category');

Route::get('/modal_add_course_category', '[email protected]_add_course_category'); Route::post('/save_category', '[email protected]_category');

//header routes Route::get('/ak_news', '[email protected]_news');

Controller

public function ak_news()
{
    $newscategory = DB::table('tak_news_category')->get();

$news = DB::table('tak_news')
    -&gt;select('tak_news.*', 'tak_news.id as newsid', 'tak_news_category.id', 'tak_news_category.tak_news_category')
    -&gt;join('tak_news_category', 'tak_news_category.id', '=', 'tak_news.tak_category_id')
    -&gt;whereRaw('MOD(tak_news.id, 2) = 0')
    -&gt;get();

$news1 = DB::table('tak_news')
    -&gt;select('tak_news.*', 'tak_news.id as newsid', 'tak_news_category.id', 'tak_news_category.tak_news_category')
    -&gt;join('tak_news_category', 'tak_news_category.id', '=', 'tak_news.tak_category_id')
    -&gt;inRandomOrder()-&gt;limit(1)
    -&gt;whereRaw('MOD(tak_news.id, 1) = 0')
    -&gt;get();
$news2 = DB::table('tak_news')
    -&gt;select('tak_news.*', 'tak_news.id as newsid', 'tak_news_category.id', 'tak_news_category.tak_news_category')
    -&gt;join('tak_news_category', 'tak_news_category.id', '=', 'tak_news.tak_category_id')
    -&gt;inRandomOrder()-&gt;limit(1)
    -&gt;get();

$latestnews = DB::table('tak_news')
    -&gt;select('tak_news.*', 'tak_news.id as newsid', 'tak_news_category.id', 'tak_news_category.tak_news_category')
    -&gt;join('tak_news_category', 'tak_news_category.id', '=', 'tak_news.tak_category_id')
    -&gt;orderBY('tak_news.id', 'DESC')
    -&gt;limit(4)
    -&gt;get();

$editors = DB::table('tak_news')
    -&gt;select('tak_news.*', 'tak_news.id as newsid', 'tak_news_category.id', 'tak_news_category.tak_news_category')
    -&gt;join('tak_news_category', 'tak_news_category.id', '=', 'tak_news.tak_category_id')
    -&gt;where('tak_news.id', '=', '6')
    -&gt;get();

return view('pages.news_page', compact('newscategory', 'news', 'news1', 'news2', 'latestnews', 'editors'));

}

View layout

<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <!-- Mobile Specific Meta -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Favicon-->
    <link rel="shortcut icon" href="img/fav.png">
    <!-- Author Meta -->
    <meta name="author" content="colorlib">
    <!-- Meta Description -->
    <meta name="description" content="">
    <!-- Meta Keyword -->
    <meta name="keywords" content="">
    <!-- meta character set -->
    <meta charset="UTF-8">
    <!-- Site Title -->
    <title>yeah</title>
    <link href="https://fonts.googleapis.com/css?family=Poppins:100,200,400,300,500,600,700" rel="stylesheet">
    <!--
    CSS
    ============================================= -->
    <link rel="stylesheet" href="css/linearicons.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/magnific-popup.css">
    <link rel="stylesheet" href="css/nice-select.css">
    <link rel="stylesheet" href="css/animate.min.css">
    <link rel="stylesheet" href="css/owl.carousel.css">
    <link rel="stylesheet" href="css/jquery-ui.css">
    <link rel="stylesheet" href="css/main.css">
</head>
<body>
    <header>

    &lt;div class="container main-menu" id="main-menu"&gt;
        &lt;div class="row align-items-center justify-content-between"&gt;
            &lt;nav id="nav-menu-container"&gt;
                &lt;ul class="nav-menu"&gt;
                    &lt;li class="menu-active"&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="archive.html"&gt;Archive&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="category.html"&gt;Category&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="menu-has-children"&gt;&lt;a href=""&gt;Post Types&lt;/a&gt;
                    &lt;ul&gt;
                        &lt;li&gt;&lt;a href="standard-post.html"&gt;Standard Post&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="image-post.html"&gt;Image Post&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="gallery-post.html"&gt;Gallery Post&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="video-post.html"&gt;Video Post&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="audio-post.html"&gt;Audio Post&lt;/a&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                &lt;/li&gt;
                &lt;li&gt;&lt;a href="about.html"&gt;About&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="contact.html"&gt;Contact&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/nav&gt;&lt;!-- #nav-menu-container --&gt;
            &lt;div class="navbar-right"&gt;
                &lt;form class="Search"&gt;
                    &lt;input type="text" class="form-control Search-box" name="Search-box" id="Search-box" placeholder="Search"&gt;
                    &lt;label for="Search-box" class="Search-box-label"&gt;
                        &lt;span class="lnr lnr-magnifier"&gt;&lt;/span&gt;
                    &lt;/label&gt;
                    &lt;span class="Search-close"&gt;
                        &lt;span class="lnr lnr-cross"&gt;&lt;/span&gt;
                    &lt;/span&gt;
                &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/header&gt;

@yield('content')

&lt;!-- start footer Area --&gt;
&lt;footer class="footer-area section-gap"&gt;
    &lt;div class="container"&gt;
        &lt;div class="row"&gt;
            &lt;div class="col-lg-3 col-md-6 single-footer-widget"&gt;
                &lt;h4&gt;Top Products&lt;/h4&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Managed Website&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Manage Reputation&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Power Tools&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Marketing Service&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div class="col-lg-2 col-md-6 single-footer-widget"&gt;
                &lt;h4&gt;Quick Links&lt;/h4&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Jobs&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Brand Assets&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Investor Relations&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Terms of Service&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div class="col-lg-2 col-md-6 single-footer-widget"&gt;
                &lt;h4&gt;Features&lt;/h4&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Jobs&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Brand Assets&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Investor Relations&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Terms of Service&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div class="col-lg-2 col-md-6 single-footer-widget"&gt;
                &lt;h4&gt;Resources&lt;/h4&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Guides&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Research&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Experts&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Agencies&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div class="col-lg-3 col-md-6 single-footer-widget"&gt;
                &lt;h4&gt;Instragram Feed&lt;/h4&gt;
                &lt;ul class="instafeed d-flex flex-wrap"&gt;
                    &lt;li&gt;&lt;img src="img/i1.jpg" alt=""&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="img/i2.jpg" alt=""&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="img/i3.jpg" alt=""&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="img/i4.jpg" alt=""&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="img/i5.jpg" alt=""&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="img/i6.jpg" alt=""&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="img/i7.jpg" alt=""&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="img/i8.jpg" alt=""&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="footer-bottom row align-items-center"&gt;

            &lt;div class="col-lg-4 col-md-12 footer-social"&gt;
                &lt;a href="#"&gt;&lt;i class="fa fa-facebook"&gt;&lt;/i&gt;&lt;/a&gt;
                &lt;a href="#"&gt;&lt;i class="fa fa-twitter"&gt;&lt;/i&gt;&lt;/a&gt;
                &lt;a href="#"&gt;&lt;i class="fa fa-dribbble"&gt;&lt;/i&gt;&lt;/a&gt;
                &lt;a href="#"&gt;&lt;i class="fa fa-behance"&gt;&lt;/i&gt;&lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/footer&gt;
&lt;!-- End footer Area --&gt;
&lt;script src="js/vendor/jquery-2.2.4.min.js"&gt;&lt;/script&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;script src="js/vendor/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBhOdIF3Y9382fqJYt5I_sswSrEw5eihAA"&gt;&lt;/script&gt;
&lt;script src="js/easing.min.js"&gt;&lt;/script&gt;
&lt;script src="js/hoverIntent.js"&gt;&lt;/script&gt;
&lt;script src="js/superfish.min.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery.ajaxchimp.min.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery.magnific-popup.min.js"&gt;&lt;/script&gt;
&lt;script src="js/mn-accordion.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery-ui.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery.nice-select.min.js"&gt;&lt;/script&gt;
&lt;script src="js/owl.carousel.min.js"&gt;&lt;/script&gt;
&lt;script src="js/mail-script.js"&gt;&lt;/script&gt;
&lt;script src="js/main.js"&gt;&lt;/script&gt;

</body>

Hope you can help me guys. Thank you.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

How to setup automatic Databases backup in Laravel

As Laravel developers we need a way to back up our app’s databases somewhere for both save keeping the data and for analysis. In this post, you'll learn how to setup automatic Databases backup in Laravel

Manage databases easily with Laravel Prequel

Laravel Prequel is a Laravel package which can be used to manage databases without the need for tools like PHPmyadmin or Sequel Pro.

The Complete Guide to Database Seeder in Laravel 6

You have lots of question what is seeder in Laravel 6? How to use seeder in Laravel 6? What is command to create seeder in Laravel 6? Why we have to use seeder in Laravel 6? That's all I will example in this Laravel 6 database seed tutorial.