laravel-4

Laravel auth CORS issue

馋奶兔 提交于 2020-02-08 09:12:28
问题 I'm having the same issue with Laravel authentication and CORS as this thread: Auth::user() returns null with CORS requests Although, my files won't be hosted on the same domain as they will be used within a Cordova smartphone application. Does anyone have any ideas how to solve this, and still use Laravels standard Auth functionality? Many thanks! 回答1: Solved this by first adding the following headers to App::before function in routes: header('Access-Control-Allow-Origin: *'); header('Access

Implementing queue for image processing in Laravel - what to queue and what not to?

穿精又带淫゛_ 提交于 2020-02-07 05:33:27
问题 I have a Laravel based application which is image intensive. Users can upload images to the server and the images are stored on Amazon s3 bucket after being resized. The process is pretty slow here and I've been reading up on queues and think they may be exactly what i need to kind of delegate the part of storing on amazon to. The only thing is that this is my postAction which handles the uploading: public function postImage(){ $images = Input::only('images'); $model->saveImages($images[

Implementing queue for image processing in Laravel - what to queue and what not to?

主宰稳场 提交于 2020-02-07 05:33:06
问题 I have a Laravel based application which is image intensive. Users can upload images to the server and the images are stored on Amazon s3 bucket after being resized. The process is pretty slow here and I've been reading up on queues and think they may be exactly what i need to kind of delegate the part of storing on amazon to. The only thing is that this is my postAction which handles the uploading: public function postImage(){ $images = Input::only('images'); $model->saveImages($images[

How do I call Validator from a namespace with an already existing Validator class

≡放荡痞女 提交于 2020-02-06 05:31:46
问题 I'm trying to test a function in phpspec which calls Laravel's Validator::make function (http://laravel.com/docs/4.2/validation) However, I'm trying to call that same function from a namespace where the Validator class name is already taken. How can I call that function described in the docs? Failed solutions: Attempt 1 return \Illuminate\Validation\Validator::make($values,$rules); gives me Call to undefined method Illuminate\Validation\Validator::make() Attempt 2 return \Illuminate

How do I call Validator from a namespace with an already existing Validator class

自古美人都是妖i 提交于 2020-02-06 05:31:07
问题 I'm trying to test a function in phpspec which calls Laravel's Validator::make function (http://laravel.com/docs/4.2/validation) However, I'm trying to call that same function from a namespace where the Validator class name is already taken. How can I call that function described in the docs? Failed solutions: Attempt 1 return \Illuminate\Validation\Validator::make($values,$rules); gives me Call to undefined method Illuminate\Validation\Validator::make() Attempt 2 return \Illuminate

How do I call Validator from a namespace with an already existing Validator class

北慕城南 提交于 2020-02-06 05:31:05
问题 I'm trying to test a function in phpspec which calls Laravel's Validator::make function (http://laravel.com/docs/4.2/validation) However, I'm trying to call that same function from a namespace where the Validator class name is already taken. How can I call that function described in the docs? Failed solutions: Attempt 1 return \Illuminate\Validation\Validator::make($values,$rules); gives me Call to undefined method Illuminate\Validation\Validator::make() Attempt 2 return \Illuminate

laravel php add to associated array generates new nodes

不打扰是莪最后的温柔 提交于 2020-02-06 05:25:27
问题 This is my array: This is my final array: $data = [ 'domain'=> $xmlDocument->domain, 'FirstDate' => $xmlDocument->dateAttribute->first_date, 'LastDate' => $xmlDocument->dateAttribute->last_date, 'Category' => $xmlDocument->category->name, 'Action' => $xmlDocument->websiteAction->name, 'Source' => $xmlDocument->source->name, 'LogFile' => $xmlDocument->log_file, 'DateAttribute' => [ 'Name' => $xmlDocument->dateAttribute->name, 'Place' => $xmlDocument->dateAttribute->dateLocation->name,

Move laravel project to new server

北城以北 提交于 2020-02-05 13:55:35
问题 I have an existing laravel (v4) project in one server. Now I want to upload it to a new server. Can anyone explain the steps how to do this? I am very new in Laravel. This is what I have done so far: I have downloaded all the files to my machine and then uploaded to my new cPanel server. Created mysql database and imported tables. 回答1: Follow the following steps: Create a new database from phpmyadmin of your new cpanel Import your previous database to the new database In app/config/database

Move laravel project to new server

橙三吉。 提交于 2020-02-05 13:53:46
问题 I have an existing laravel (v4) project in one server. Now I want to upload it to a new server. Can anyone explain the steps how to do this? I am very new in Laravel. This is what I have done so far: I have downloaded all the files to my machine and then uploaded to my new cPanel server. Created mysql database and imported tables. 回答1: Follow the following steps: Create a new database from phpmyadmin of your new cpanel Import your previous database to the new database In app/config/database

Make multiple AJAX request using the same session

感情迁移 提交于 2020-02-05 06:36:25
问题 I have a REST webservice that returns an hash value based on the current http session. If I open the webservice page using a browser, I will see the same value refreshing the page or opening the page in multiple tab. This is the expected behavior because I'm using the same session on multiple request. If I do an AJAX request using the $http service of AngularJS, I obtain a different value each time. It seems that each request uses a different session. I need to obtain the same behavior like