laravel-4

It seems that not all of my HTML page loads in some browsers

拟墨画扇 提交于 2019-12-10 18:24:53
问题 This is a weird one. I am not quite sure of what is going on. I don't know if it's MAMP server causing the problems or Laravel. I never seen this before. I am using Google Chrome on my MAC OS X. And in the console I get a GET error. But when I go to networking it still shows it as an error and when I click the tabs like Response it show that nothing loaded... Even if there is content on the page. Then when I click on Headers it says the Status is 200... So good... Confused yet? Even preview

Laravel 4.2 artisan CLI does not work anymore after composer update

梦想的初衷 提交于 2019-12-10 18:17:21
问题 I just ran "composer update" on my production server, and received this error: Script php artisan clear-compiled handling the post-update-cmd event returned with an error When I try any "php artisan" commands, I do not receive any results. I have tried deleting my composer.lock file and my vendor folder, and ran "composer install" again, but no results. Here is my composer.json file: { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"],

How can I use php-FFMpeg in laravel 4?

你。 提交于 2019-12-10 17:48:38
问题 I am new to Laravel 4. I have installed php-ffmpeg in my local Laravel setup, but I need help on how to use this ffmpeg with Laravel 4? 回答1: Assuming that you already have ffmpeg installed on your localhost server, then in Laravel, you need to set the paths for the ffmpeg and ffprobe binaries, like so: $ffmpeg = FFMpeg\FFMpeg::create(array( 'ffmpeg.binaries' => '/usr/local/Cellar/ffmpeg/2.1.3/bin/ffmpeg', 'ffprobe.binaries' => '/usr/local/Cellar/ffmpeg/2.1.3/bin/ffprobe', 'timeout' => 3600, /

Laravel - Overriding a resource route into a different route filter group

旧街凉风 提交于 2019-12-10 17:47:15
问题 Laravel's routing doesn't seem to be working as expected? From what I understand, if I intend to override a route, all I need to do is to put the expected route before the other one. What I have is something like this: Route::group(array('before'=>'defaultLoads'), function(){ Route::post('newsletter', 'NewsletterController@store'); Route::group(array('before'=>'login'), function(){ Route::resource('newsletter','NewsletterController'); } }); Which I assumed that if i post to this route http:/

Self-referencing models cause Maximum function nesting level of x in Laravel 4

牧云@^-^@ 提交于 2019-12-10 17:46:26
问题 I'm working on a reasonably large Laravel project and am using Repositories. I have a user repository which injects its dependencies like so: public function __construct(CartRepository $cartRepo...) This causes the following error: Maximum function nesting level of '100' reached, aborting! I think this is because the CartRepo injects an ItemRepo which in turn injects the UserRepo, causing an infinite nesting loop. What I don't get is how to find away around this, the ItemRepo needs the

laravel queue daemon mail stops functioning with SSL error

心已入冬 提交于 2019-12-10 17:36:33
问题 I am running a laravel queue daemon, which sends mail depending on the actions taken. This is running through supervisor to ensure it always runs. It works fine at first, but after some time the mail stops sending. The error is not reporting up the chain, but the logs show: [2014-07-30 20:00:21] production.ERROR: exception 'ErrorException' with message 'fwrite(): SSL operation failed with code 1. OpenSSL Error messages: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry' in /srv

How to pass variables by reference to @include in a blade template?

断了今生、忘了曾经 提交于 2019-12-10 17:22:44
问题 In a Laravel 4.2 setup, I have a variable in a template that I wish to share across multiple includes: master.blade <?php $tabindex = 0; ?>{{--This is the variable--}} @include('header'){{-- <-in header.blade, I often use ++$tabindex --}} {{--$tabindex is still 0--}} @include('content'){{-- <-in content.blade, I often use ++$tabindex --}} {{--$tabindex is still 0--}} @include('footer'){{-- <-in footer.blade, I often use ++$tabindex --}} {{--$tabindex is still 0--}} $tabindex if used as a

exporting large files to excel using PHPExcel

陌路散爱 提交于 2019-12-10 17:16:10
问题 I am trying to export around 40,000 rows of Mysql data in PHP(Laravel4) using PHPExcel library. Below is my code: ($patList is an array of result columns) set_time_limit ( 3000 ); $cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_phpTemp; $cacheSettings = array( 'memoryCacheSize' => -1); PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); $objPHPExcel = new PHPExcel(); $i = 1; $patList = $result[0]; for ($r = 0; $r < count($patList); $r++) { $objPHPExcel-

Laravel 4 - Assign OnChange to Form::select

♀尐吖头ヾ 提交于 2019-12-10 16:46:57
问题 Is there a way of assigning an OnChange event to a Form::Select field? I've managed to get around it at the moment but it's very messy and I'd like to change it so all my ajax requests are within one file... Anyone else come across this? Thanks. 回答1: Managed to fix it guys. {{ Form::select('name', $options, 'default', array('id' => 'some-id'); }} Then just the ID to assign the onChange event in your JS: $(function(){ $('some-id').change(function(e) { //perform AJAX call }); }); 回答2: The

Laravel: running artisan gives me “Unexpected character in input” error

与世无争的帅哥 提交于 2019-12-10 16:44:58
问题 When I run php artisan list in my production environment (Debian Linux, private server), I get the following error: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/user/app/artisan on line 46 Parse error: syntax error, unexpected T_STRING in /home/user/app/artisan on line 46 Why is that and how can I fix this? 回答1: So there's a parse error on this line: $artisan = Illuminate\Console\Application::start($app); The PHP parser didn't expect a \ there, which is used for