Php 如何使用centos服务器查看我对laravel的看法
我在文件夹Php 如何使用centos服务器查看我对laravel的看法,php,laravel-5,centos6,Php,Laravel 5,Centos6,我在文件夹/var/www/html/myproject中有我的laravel项目,当我在浏览器示例中键入路由时:127.0.0.2/api/v1/cuentas(因为我使用公共IP)我看不到我的视图,它会穿透我 Not Found The requested URL /api/v1/cuentas was not found on this server. Apache/2.2.15 (CentOS) Server at (ip) Port 80 cuentas文件是php 我设置了权限
/var/www/html/myproject
中有我的laravel项目,当我在浏览器示例中键入路由时:127.0.0.2/api/v1/cuentas
(因为我使用公共IP)我看不到我的视图,它会穿透我
Not Found
The requested URL /api/v1/cuentas was not found on this server.
Apache/2.2.15 (CentOS) Server at (ip) Port 80
文件是phpcuentas
- 我设置了权限
Route::group(array('prefix' => 'api/v1'), function()
{
Route::resource('cuentas','cuentaPruebaController');
});
我的控制器:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\cuentum;
class cuentaPruebaController extends Controller
{
public function index() {
try {
$response = [
'cuentas' => []
];
$statusCode = 200;
$cuenta = \App\cuentum::all();
foreach ($cuenta as $item) {
$response['cuentas'][] = [
'id_cuenta' => $item->id_cuenta,
'nombre' => $item->nombre,
'apellido' => $item->apellido,
'ci' => $item->ci,
'domicilio' => $item->domicilio,
'telefono' => $item->telefono,
'dispositivo_id' => $item->dispositivo_id,
'estado' => $item->estado,
];
}
} catch (Exception $e) {
$statusCode = 404;
} finally {
return \Response::json(array($response, $statusCode));
}
}
}
什么是帐户
文件?控制器?是…是控制器请共享控制器和路由。php问题已更新。感谢您的时间。使用php artisan route:list
,这将为您提供可用的路由列表。检查这些并在此处共享什么是帐户
文件?控制器?是…是控制器请共享控制器和路由。php问题已更新。感谢您的时间。使用php artisan route:list
,这将为您提供可用的路由列表。检查这些并在这里分享