laravel 5 แก้ไข public folder สำหรับ Shared host

laravel5 2 พ.ย. 2015

เวลาที่เราใช้ laravel 5 จะมี folder หลักที่ทำงานร่วมกับ host คือ public ซึ่งที่ Shared host ต้องการคือ public_html เราสามารถ rename public เป็น public_html แต่ laravel จะยังไม่รู้ว่าเราได้เปลี่ยน public ไปแล้ว ทางแก้คือ

เพิ่ม code ข้างล่างนี้ไปไว้ที่ App/Providers/AppServiceProvider.php

app->bind('path.public', function() {
          return base_path().'/public_html';
        });
    }

}

แท็ก

Onyx

Just a middle-aged programmer, Can do many things but not the most.