laravel-4

Fatal error: Class 'TestCase' not found in (laravel) Php Storm

依然范特西╮ 提交于 2019-12-23 21:35:03
问题 I create a laravel framework fresh copy from composer and when run on PHP Storm i m facing this error in PHP Storm Fatal error: Class 'TestCase' not found in C:\xampp\htdocs\testproject\app\tests\ExampleTest.php on line 3 cd C:\xampp\htdocs\testproject Current working directory is 'C:\xampp\htdocs\testproject'. phpunit Cannot run program "phpunit" (in directory "C:\xampp\htdocs\testproject" ): CreateProcess error=2, The system cannot find the file specified 回答1: I had this problem in the past

Laravel/blade caching css files

喜你入骨 提交于 2019-12-23 21:34:38
问题 I am working on Nginx server, with PHP-FPM. I installed Laravel 4.1 and bootstrap v3.1.1. , and here is the problem. For the last 30 minutes, I have been trying to change a css rule that I first declared to check boostrap. .jumbotron{ background: red; } The first time it worked. The jumbotron container was red. So, I removed that css value and started working, but still no matter which browse I use, the container is red. I even checked the css file through the Google Chromes inspection tool,

Redirect loop in laravel

半腔热情 提交于 2019-12-23 21:33:40
问题 How to use before filter in Laravel in a group? Route::group(['before'=>'auth','domain' => 'm.domain.us'], function(){ ... Route::get('/','PageController@index'); }); I tried in this way, if I use only domain in group it works but I want to use auth filter on all pages in this group because it is admin section and when I entered 'before' => 'admin' and it gets an error: This webpage has a redirect loop. Where is the problem here? 回答1: Probably this occurs because your Login-Route is inside

Laravel 4.2 created_at column gives “The format separator does not match” error

一个人想着一个人 提交于 2019-12-23 21:33:23
问题 I am trying to access the created_at column in one of my models and I get the following error: The format separator does not match. The format separator does not match. The format separator does not match. The error actually repeats 3 times. This is how I try to access the column: $model->created_at I do not have $timestamps set to false in my model and I can access the other columns just fine. What is the problem? 回答1: Did you override the getDateFormat() in your model? I ran into this

Composer - Forked Laravel 4.2 not installing

与世无争的帅哥 提交于 2019-12-23 19:20:33
问题 I have cloned the Laravel 4.2 branch from Github and pushed it to a private GitLab server. I've created a new branch from 4.2 with the name dev-bugfix and added a comment in 1 file to see if composer would install my fork and not the official Laravel. My steps: Cloned Laravel 4.2 branch from Github Pushed the repo to a private GitLab server In an existing Laravel application, removed composer.lock, ran composer dump-autoload and removed the entire vendor folder Edited composer.json to include

Laravel 4.2 - ReflectionException (-1)

蓝咒 提交于 2019-12-23 19:11:18
问题 I am getting following error: ReflectionException (-1) Class PhotosController does not exist This is my route: Route::resource('photos', ' PhotosController'); When I change to Route::get('photos', 'PhotosController@index'); it is working fine, but using resource it is falling? What is going on? PhotosController: <?php class PhotosController extends \BaseController { /** * Display a listing of the resource. * GET /photos * * @return Response */ public function index() { return Photo::all(); }

Laravel 4 on PHP built-in web server (CGI) instead of Apache

你说的曾经没有我的故事 提交于 2019-12-23 18:45:57
问题 I am trying to run laravel4 on a service that cannot use Apache or nginx. everything is good till I wanted to use Routes on my project. I've tried using /index.php/... on the URL but could not make this work. is there any way to force laravel not to use .htaccess file or any ways to use raw PHP routing? 回答1: Try setting the "application.url" option in one of configuration files, probably in app/config/application.php or application/config/application.php: https://github.com/laravel/laravel

Laravel cookie::forget doesn't work?

一个人想着一个人 提交于 2019-12-23 16:28:10
问题 I have this code: Cookie::forget('vendor'); return Redirect::route('vendor_login'); What it is supposed to do, is remove the vendor cookie and redirect you to the login page. However, it doesn't actually delete the cookie. From my understanding, I would expect it to send a setcookie header for vendor with a value of null and a negative time. It doesn't send the setcookie header at all. Why is this? This works perfectly: Cookie::queue('paddle_vendor', null, -1); return Redirect::route('vendor

Laravel: Cant set JSON utf-8 charset

萝らか妹 提交于 2019-12-23 16:00:05
问题 I have a specific problem in Laravel . When I use echo or print_r or var_dump my data (retrieved from eloquent) are printed in the right format (UTF-8, greek language). But when I use return Response::json($data) returns something like "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03bf\u03af \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2" I have already set UTF-8 as default charset in my php.ini , mysql.conf (but this is not the problem). I have tried several ways to set the

Call to a member function where() on a non-object Laravel 4.2

元气小坏坏 提交于 2019-12-23 15:49:43
问题 I am attempting to use and id that being passed into the URL to edit the query but when attempting to run the code I get an error of: Call to a member function where() on a non-object Controller class HomeController extends BaseController { public function showWelcome() { $id = intval($_GET['wab_id']); $results = DB::Table('films')->get()->where('wab_id','=', $id); print_r($results); while ($row=mysql_fetch_array($results)) { $url = $row['url']; } return View::make('hello')->with('row', $url)