laravel-4

Laravel Is php-mcrypt necessary for https and Auth?

守給你的承諾、 提交于 2019-12-24 13:33:24
问题 Everything is in the title : can I use https and the Auth:: class whithout having installed php mcrypt ? (I'm on a redhat enterprise linux 6.1 on architecture s390x, it's just impossible to find pre-compiled packages). If it's possible then I would just use Laravel whithout Mcrypt... 回答1: mcrypt is a requirement of Laravel, you simply cannot run a laravel app without having mcrypt installed. The following link may help with installing mcrypt: http://injustfiveminutes.com/2012/11/23/install

Bootstrap 3.1 with laravel 4.0

江枫思渺然 提交于 2019-12-24 13:21:48
问题 I have problem to display confirmation dialog box when I click the delete button it show the confirmation dialog and also submit the form without clicking the button in confirmation dialog box. I'm using bootstrap and laravel. here is the code. <div class="modal fade" id="confirmDelete" role="dialog" aria-labelledby="confirmDeleteLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"

Laravel Checking whether it has data or not from the model

可紊 提交于 2019-12-24 12:53:16
问题 I am receiving the data from url and sending it to the model to and then displaying in the model like this. public function BlogDisplay($data=NULL) { $BlogData = BlogModel::where('BlogLink', '=', $data)->get(); return View::make('Blogs', array('BlogData' => $BlogData)); And then in the view. But to check whether it has the data or not I am doing that in the view like this: <?php if($BlogData) { var_dump($BlogData); echo 'has data'; } else { var_dump($BlogData); echo 'has no data'; } ?> But

Twitter typeahead not matching correctly when using “remote”, but working with “local” JSON

不羁的心 提交于 2019-12-24 12:52:50
问题 I'm creating an autocomplete in Laravel 4 using twitter typeahead, but I'm having problems in the matching process. The JS code: $('#autocomplete').typeahead({ limit: 20, name: 'destinatari', prefetch: '{{URL::to("alumni/posta/utenti")}}', remote: '{{URL::to("alumni/posta/utenti")}}' }); The model populates the array like this: public static function jsonList($idLogged) { $users = DB::table('users_data') ->where('userid', '!=', $idLogged) ->select('nome', 'nome_2', 'cognome', 'cognome_2',

Laravel stripping $_GET parameters

牧云@^-^@ 提交于 2019-12-24 12:39:21
问题 I am setting up an OAuth2 callback, and Laravel appears to be stripping any parameters passed via the URL (aka GET). This includes Input::get() , Input::all() , as well as the general PHP $_GET and even $_SERVER['QUERY_STRING'] . My initial reaction was an Nginx config error. But I am able to setup a test PHP file in my laravel/public directory which simply is: <?php var_dump($_GET) Hitting /test.php?code=123456ABCD generates the expected dump of an single value array. Then, in Laravel routes

Laravel pagination redirect

让人想犯罪 __ 提交于 2019-12-24 12:35:01
问题 I'm using Laravel 4 pagination, and want to remove the page=1 and serve the default string instead; for example: http://domain.com/search-results/ instead of http://domain.com/search-results/?page=1 Of course, for page >=2, it's just fine to leave: http://domain.com/search-results/?page=2 回答1: Currently Laravel will always default to showing ?page=1 . Accomplishing what you want (always defaulting to not showing ?page=1 ) involves a mix of extending/using your own Presenter and/or also by

why do I get preg_replace() error when submitting a post form in Laravel?

瘦欲@ 提交于 2019-12-24 11:54:23
问题 I have built a simple application laravel 4. I have scaffolding setup for adding posts which seems to be working fine. I have setup Stapler and image uploading package. When I setup to use single image uploads its pretty good and it works a charm. I recently looked at the docs here It states that you can do multiple uploads so I went about doing it as explained in the docs. Here are my coded pages: Post.php model: <?php class Post extends Eloquent { use Codesleeve\Stapler\Stapler; protected

reload all packages using composer

自闭症网瘾萝莉.ら 提交于 2019-12-24 11:54:10
问题 Is it possible to reload all the packages installed using composer? I'm not sure if I made an accidental change to the source of on of the packages, and my app stopped working so I want to rule this out by reloading all the packages. 回答1: You can generally just wipe the vendor/ directory and then run composer install to get everything back from your last known state (stored in composer.lock). Some plugins/custom installers in some frameworks however drop packages outside the vendor dir, but

Laravel 4 Database insert Error - preg_replace(): Parameter mismatch, pattern is a string while replacement is an array

空扰寡人 提交于 2019-12-24 11:42:31
问题 In database seeder, I just want to insert some hard-coded data to the table. $Pro1_id = DB::table('projects')->select('id')->where('projectName', '=', 'Project A')->get(); $data1_1 = array( 'id' => 1, 'projectID' => $Pro1_id, 'attributeID' => 1, 'levelID' => 2, 'percentage' => 20, 'risk_value' => 25186.86311, 'expectation_value' => 706455.9401, ); $data1_2 = array( 'projectID' => $Pro1_id, 'attributeID' => 2, 'levelID' => 1, 'percentage' => 60, 'risk_value' => 530351.3397, 'expectation_value'

chdir(): No such file or directory (errno 2)

扶醉桌前 提交于 2019-12-24 11:37:34
问题 I'm getting the above error when running composer install --working-dir=/path/to/directory In case you're wondering: I had a hard drive failure so I needed to re-install composer and well... everything. After installing composer, navigating to the directory with the composer.json file and running composer install would result in an error that composer couldn't find a composer.json file, hence the --working-dir flag. The project is a Laravel 4.2 project. We have everything in a git repo with