Postingan lainnya
laravel error(newbie)
gan, ane ikutin tutorial laravel sekolah koding kan, nah ane ikutin sampe video ketiga dengan judul "controller & blade" ane dapet error
C:\Users\BN000031691\blog\app\Http\Controllers\Controller.php
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
Arguments
"Namespace declaration statement has to be the very first statement or after any declare call in the script"
ini kodingan ane di route ->
<?php
Route::get('/', function () {
return view('welcome');
});
Route::get('/blog','BlogController@index' );
ini yang di controller ->
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BlogController extends Controller
{
public function index()
{
return ' hello hello';
}
}
bingung ane. tutorial ngga ada yg lewat padahal. ane jalanin di localhost:8000/blog gan. ane pake xampp.
mohon bantuannya gan. thanks.
(edit) sudah terjawab di another forum. terimakasih.
0