laravel-4

Swift_TransportException error in laravel

倾然丶 夕夏残阳落幕 提交于 2019-12-10 13:57:18
问题 I'm trying to create a contact form that email the message to my email address. When I tested it out I got this error Swift_TransportException Expected response code 250 but got code "530", with message "530 5.7.0 Must issue a STARTTLS command first. bv17sm3597476wib.13 - gsmtp " This is my controller public function contact() { $data = array( 'name' => Input::get('name') ); Mail::send('emails.contact', $data, function($message){ $message->to('test@gmail.com', 'Nikki')->subject('Login Details

Laravel, dump-autoload without Shell Access

那年仲夏 提交于 2019-12-10 13:56:18
问题 I have two controllers with the same name: app\controllers\CareersController.php (for public use) app\controllers\Admin\CareersController.php (for admins) Because of the naming conflict, I added namespace admin; to the admin controller. Everything works fine locally but when I uploaded the new admin controller to my server, I get an error: Class Admin\CareersController does not exist From what I understand, the fix is: php artisan dump-autoload and composer dump-autoload However, I don't have

Getting started with chef, and running composer install on deploy

折月煮酒 提交于 2019-12-10 13:53:34
问题 We're looking to deploy a few Laravel4 based PHP apps on amazon with OpsWorks, this requires a few things: Grab code from git Download composer.phar from getcomposer.com Run php composer.phar install Change permissions on a few specific folders I'm completely fresh with it comes to chef, so initially looking for a place to get to grips with the basics of chef, and then how to achieve the tasks above, would appreciate any pointers. 回答1: I'm no Chef guru (I usually use Puppet) but try the

Why the filter does not work when the back button of the browser is pressed in laravel?

坚强是说给别人听的谎言 提交于 2019-12-10 13:51:39
问题 I have a view to enter an account, then called the controller where the data is validated and are then saved with the method of authentication public function doLogin(){ $rules = array( 'email' => 'required|email', 'password' => 'required' ); $validator = Validator::make(Input::all(), $rules); //dd(Input::all()); if($validator->fails()){ return Redirect::to('usuarios')->withErrors($validator)->withInput(Input::except('password')); }else{ $userdata = array( 'email' => Input::get('email'),

Laravel Schema Builder alter storage engine

给你一囗甜甜゛ 提交于 2019-12-10 13:36:32
问题 I am trying to alter a table and change it's storage engine to InnoDb . When I run php artisan migrate it completes without error. However when I check the storage engine in Sequel Pro, nothing is changed. public function up() { Schema::table('tests', function(Blueprint $t) { $t->engine = 'InnoDB'; $t->foreign('group_id')->references('id')->on('test_groups')->onDelete('restrict'); }); } 回答1: Since @alexrussell confirmed my believe, I'm almost certain you can only define the storage engine

advantage of repository pattern in laravel against instantiating a model in a controller constructor

狂风中的少年 提交于 2019-12-10 13:34:37
问题 let's take two example. Example 1 ( Repository pattern ) Interface interface FooInterface { public function all(); } Model (Using it in a loose term) class FooModel implements FooInterface { public function all() { return DB::('sometable')->get(); } } Service Provider class FooServiceProvider extends ServiceProvider { public function register() { $this->app->bind( 'Foo\FooInterface', 'Foo\FooModel' ); } config/app.php 'providers' => array( // -- 'Foo\FooServiceProvider' ), And at last the

public_path() laravel not working

旧巷老猫 提交于 2019-12-10 13:32:56
问题 public_path() isn't working for me (local environment works, production returns empty string). All other path functions are working correctly (app, base and storage). I searched on google but not find a solution. Can somebody help me? 回答1: The OP solved his problem by himself. I'm only posting this answer so it's more visible and the question doesn't show up under "unanswered" The configuration value for the public path may needs to be adjusted. bootstrap/paths.php 'public' => __DIR__.'/..

How do I define a default fallback route in Laravel?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 13:14:09
问题 I'm currently upgrading a custom CMS from Laravel 3 to Laravel 4 (this upgrade is important for various reasons). In the existing version, it has routing set up so that routes can be individually defined--but if someone tries to load a route that is not specifically defined, the system catches it and sends it to a "page processor"--which essentially checks to see if the CMS page/post exists in the database. The "fallback" or "default" route processing line in Laravel 3 looked like this: Route

Laravel redirection from private method

一个人想着一个人 提交于 2019-12-10 13:01:48
问题 I have a controller that has a method. The code is too long in the method, so I have put some of the codes in other private methods, so that methods become understandable and not make a mess out of it. Now, when I access the public method from the URL, depending on parameters, it will call a specific private method to process the job. After the job is processed, I want to redirect to a URL, but the redirection is not working. A sample of my code is as follows: class SomeClass extends

Avoid page reload when submitting form using ajax with laravel

╄→гoц情女王★ 提交于 2019-12-10 13:00:02
问题 I'm completely stuck trying to process a form submit using ajax instead of laravel to avoid page reload etc. But it isn't working and I don't know why. I've searched the wonderful web going through example after example but nothing seems to be working for me. This is the closest I can get. My knowledge is limited but my ambitions are high. Please take a moment and look through my code, beacuse I'm at the edge of mental breakdown right now. Here is my jquery: $(document).ready(function() { $('