how set laravel 5.7 routing











up vote
-1
down vote

favorite












I generated a controller using php artisan make:controller BoardController
but I get a 404 error when I try to reach localhost/write.



Does someone know what is problem?





web.php



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

Route::get('write', 'BoardController@write');


BoardController



class BoardController extends Controller
{
public function write()
{
return view('write');
}
}


write.blade.php



<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
this is write page
</body>
</html>









share|improve this question




















  • 2




    Are you using Apache/Nginx for serving the app? or php artisan serve ? Also, is the 404 the page one issued by Laravel or the web server?
    – Jeevan
    Nov 22 at 8:00










  • As the above comment, what are you using to host the application? nginx, apache? Maybe wamp / xampp ? Your question is missing this information to help with the environment you want to use
    – killstreet
    Nov 22 at 8:59










  • i using apache2 server. and i want use apache, not artisan.
    – Yoon
    Nov 23 at 0:59










  • I have copy laravel/public files in var/www/html.
    – Yoon
    Nov 23 at 1:03















up vote
-1
down vote

favorite












I generated a controller using php artisan make:controller BoardController
but I get a 404 error when I try to reach localhost/write.



Does someone know what is problem?





web.php



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

Route::get('write', 'BoardController@write');


BoardController



class BoardController extends Controller
{
public function write()
{
return view('write');
}
}


write.blade.php



<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
this is write page
</body>
</html>









share|improve this question




















  • 2




    Are you using Apache/Nginx for serving the app? or php artisan serve ? Also, is the 404 the page one issued by Laravel or the web server?
    – Jeevan
    Nov 22 at 8:00










  • As the above comment, what are you using to host the application? nginx, apache? Maybe wamp / xampp ? Your question is missing this information to help with the environment you want to use
    – killstreet
    Nov 22 at 8:59










  • i using apache2 server. and i want use apache, not artisan.
    – Yoon
    Nov 23 at 0:59










  • I have copy laravel/public files in var/www/html.
    – Yoon
    Nov 23 at 1:03













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I generated a controller using php artisan make:controller BoardController
but I get a 404 error when I try to reach localhost/write.



Does someone know what is problem?





web.php



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

Route::get('write', 'BoardController@write');


BoardController



class BoardController extends Controller
{
public function write()
{
return view('write');
}
}


write.blade.php



<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
this is write page
</body>
</html>









share|improve this question















I generated a controller using php artisan make:controller BoardController
but I get a 404 error when I try to reach localhost/write.



Does someone know what is problem?





web.php



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

Route::get('write', 'BoardController@write');


BoardController



class BoardController extends Controller
{
public function write()
{
return view('write');
}
}


write.blade.php



<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
this is write page
</body>
</html>






php laravel routes






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 9:57









P. Ellul

400314




400314










asked Nov 22 at 7:45









Yoon

375




375








  • 2




    Are you using Apache/Nginx for serving the app? or php artisan serve ? Also, is the 404 the page one issued by Laravel or the web server?
    – Jeevan
    Nov 22 at 8:00










  • As the above comment, what are you using to host the application? nginx, apache? Maybe wamp / xampp ? Your question is missing this information to help with the environment you want to use
    – killstreet
    Nov 22 at 8:59










  • i using apache2 server. and i want use apache, not artisan.
    – Yoon
    Nov 23 at 0:59










  • I have copy laravel/public files in var/www/html.
    – Yoon
    Nov 23 at 1:03














  • 2




    Are you using Apache/Nginx for serving the app? or php artisan serve ? Also, is the 404 the page one issued by Laravel or the web server?
    – Jeevan
    Nov 22 at 8:00










  • As the above comment, what are you using to host the application? nginx, apache? Maybe wamp / xampp ? Your question is missing this information to help with the environment you want to use
    – killstreet
    Nov 22 at 8:59










  • i using apache2 server. and i want use apache, not artisan.
    – Yoon
    Nov 23 at 0:59










  • I have copy laravel/public files in var/www/html.
    – Yoon
    Nov 23 at 1:03








2




2




Are you using Apache/Nginx for serving the app? or php artisan serve ? Also, is the 404 the page one issued by Laravel or the web server?
– Jeevan
Nov 22 at 8:00




Are you using Apache/Nginx for serving the app? or php artisan serve ? Also, is the 404 the page one issued by Laravel or the web server?
– Jeevan
Nov 22 at 8:00












As the above comment, what are you using to host the application? nginx, apache? Maybe wamp / xampp ? Your question is missing this information to help with the environment you want to use
– killstreet
Nov 22 at 8:59




As the above comment, what are you using to host the application? nginx, apache? Maybe wamp / xampp ? Your question is missing this information to help with the environment you want to use
– killstreet
Nov 22 at 8:59












i using apache2 server. and i want use apache, not artisan.
– Yoon
Nov 23 at 0:59




i using apache2 server. and i want use apache, not artisan.
– Yoon
Nov 23 at 0:59












I have copy laravel/public files in var/www/html.
– Yoon
Nov 23 at 1:03




I have copy laravel/public files in var/www/html.
– Yoon
Nov 23 at 1:03












2 Answers
2






active

oldest

votes

















up vote
-1
down vote



accepted










you can run your project in these two ways, these are:



Option 1: run php artisan serve command then write url in your browser like
http://localhost:8000/ your route name



Option 2 : write url in your browser like
localhost/your project name/your route name






share|improve this answer





















  • i tried, but not working
    – Yoon
    Nov 23 at 1:01










  • Can you please tell me the details problem?
    – Hasib Islam
    Nov 23 at 6:15


















up vote
-2
down vote













Please run below command:



php artisan serve


then your URL like http://localhost:8000/write






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53426091%2fhow-set-laravel-5-7-routing%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    -1
    down vote



    accepted










    you can run your project in these two ways, these are:



    Option 1: run php artisan serve command then write url in your browser like
    http://localhost:8000/ your route name



    Option 2 : write url in your browser like
    localhost/your project name/your route name






    share|improve this answer





















    • i tried, but not working
      – Yoon
      Nov 23 at 1:01










    • Can you please tell me the details problem?
      – Hasib Islam
      Nov 23 at 6:15















    up vote
    -1
    down vote



    accepted










    you can run your project in these two ways, these are:



    Option 1: run php artisan serve command then write url in your browser like
    http://localhost:8000/ your route name



    Option 2 : write url in your browser like
    localhost/your project name/your route name






    share|improve this answer





















    • i tried, but not working
      – Yoon
      Nov 23 at 1:01










    • Can you please tell me the details problem?
      – Hasib Islam
      Nov 23 at 6:15













    up vote
    -1
    down vote



    accepted







    up vote
    -1
    down vote



    accepted






    you can run your project in these two ways, these are:



    Option 1: run php artisan serve command then write url in your browser like
    http://localhost:8000/ your route name



    Option 2 : write url in your browser like
    localhost/your project name/your route name






    share|improve this answer












    you can run your project in these two ways, these are:



    Option 1: run php artisan serve command then write url in your browser like
    http://localhost:8000/ your route name



    Option 2 : write url in your browser like
    localhost/your project name/your route name







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 22 at 10:05









    Hasib Islam

    14




    14












    • i tried, but not working
      – Yoon
      Nov 23 at 1:01










    • Can you please tell me the details problem?
      – Hasib Islam
      Nov 23 at 6:15


















    • i tried, but not working
      – Yoon
      Nov 23 at 1:01










    • Can you please tell me the details problem?
      – Hasib Islam
      Nov 23 at 6:15
















    i tried, but not working
    – Yoon
    Nov 23 at 1:01




    i tried, but not working
    – Yoon
    Nov 23 at 1:01












    Can you please tell me the details problem?
    – Hasib Islam
    Nov 23 at 6:15




    Can you please tell me the details problem?
    – Hasib Islam
    Nov 23 at 6:15












    up vote
    -2
    down vote













    Please run below command:



    php artisan serve


    then your URL like http://localhost:8000/write






    share|improve this answer



























      up vote
      -2
      down vote













      Please run below command:



      php artisan serve


      then your URL like http://localhost:8000/write






      share|improve this answer

























        up vote
        -2
        down vote










        up vote
        -2
        down vote









        Please run below command:



        php artisan serve


        then your URL like http://localhost:8000/write






        share|improve this answer














        Please run below command:



        php artisan serve


        then your URL like http://localhost:8000/write







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 22 at 7:51









        Khalifa Nikzad

        69011




        69011










        answered Nov 22 at 7:50









        Saurabh Dhariwal

        92812




        92812






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53426091%2fhow-set-laravel-5-7-routing%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Sphinx de Gizeh

            Dijon

            Get global maximum slope