laravel-4

How to pass mail data from service provider to config/mail.php in laravel 4

只愿长相守 提交于 2019-12-11 04:48:13
问题 I was fetch mail configuration data using model file, and pass it to my provider the name CofigServiceProvider.php. But i don't know how to pass it into config/mail.php file. Because i need to change the mail configuration data dynamically from my admin panel. or Any other way to fetch db values and pass it app/config/mail.php in laravel 4 ConfigServiceProvider.php <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Config; use Home; class ConfigServiceProvider extends

Laravel mass assignment won't fill fields

蹲街弑〆低调 提交于 2019-12-11 04:45:59
问题 I have a model that doesn't seem to be mass assignable, even though I have filled in the $fillable fields: class LoginAttempt extends Eloquent { protected $table = 'login_history'; protected $fillable = array('remote_addr', 'user_agent', 'successful'); public function user() { return $this->belongsTo('User'); } } Which is using this schema: login_history id user_id remote_addr user_agent successful created_at updated_at When I mass assign the instance with these variables, $vars = array(

Laravel 4 migration:install ErrorException

淺唱寂寞╮ 提交于 2019-12-11 04:24:32
问题 php artisan migrate:install {"error":{"type":"ErrorException","message":"PDO::__construct(): [2002] Connection refused (trying to connect via tcp:\/\/127.0.0.1:3306)","file":"\/Applications\/MAMP\/htdocs\/DRCSports\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connectors\/Connector.php","line":47}} In my database.php I have updated the information to mysql 'mysql' => array( 'driver' => 'mysql', 'host' => '127.0.0.1', 'database' => 'Laravel_DRCSports', 'username' => 'root', 'password

Laravel best way to save data one to one relationships?

陌路散爱 提交于 2019-12-11 04:19:20
问题 Terms table: term_id name slug Term_taxonomy table: term_taxonomy_id term_id description My Term model: public function TermTaxonomy(){ return $this->hasOne('TermTaxonomy'); } public function saveCategory($data){ $validator = Validator::make($data,$this->rules); if($validator->passes()){ $this->name = $data['name']; $this->slug = $data['slug']; if($this->save()){ $category_taxo = new TermTaxonomy; $category_taxo->term_id = $this->lastCategoryId(); $category_taxo->taxonomy = 'category';

Import laravel 4.2 project into eclipse

此生再无相见时 提交于 2019-12-11 03:58:44
问题 I have installed laravel 4.2 via composer and created in the htdocs folder of my xampp installation a new project. When I enter localhost everything runs perfectly fine. Now I would like to import this project into eclipse luna . I have alredy installed the pdt plugin under eclipse. However, how to import the laravel project, for further development? I appreciate your replies! 回答1: Here are the steps: Go to File > Import Existing folder as New Project Find the folder and click Finish 来源:

How to get all column with some having same name when using laravel eloquent?

淺唱寂寞╮ 提交于 2019-12-11 03:55:29
问题 Let say I have 2 tables with column like this: table_a: (with a corresponding model TableA) id | (20+ other field) | deleted_at | created_at | updated_at table_b: (with a corresponding model TableB) id | a_id | ( 30+ other field ) | deleted_at | created_at | updated_at Now I am using laravel and join on this two table $result = TableA::join('table_b', 'table_a.id', '=', 'table_b.a_id') ->where('table_b.created_at', '>=', date('Y-m-d')) ->get(); The problem is that I am not able to some field

Configuring oauth2-server-laravel with laravel-mongodb

我的梦境 提交于 2019-12-11 03:55:13
问题 I am trying to use oauth2-server-laravel with laravel-mongodb. After I generate migration using this command php artisan oauth2-server:migrations I tried to use php artisan migrate . But I got this error. [ErrorException] Missing argument 1 for Illuminate\Database\Schema\Blueprint::primary(), called in /home/opu/www/cwc_penguins/app/database/migrations/2015_01_19_203037 _create_oauth_scopes_table.php on line 17 and defined 2015_01_19_203037_create_oauth_scopes_table.php Migration code here <

Laravel : search or filter the collection

≯℡__Kan透↙ 提交于 2019-12-11 03:47:50
问题 I have this issue while filtering or searching through a collection http://laravel.io/bin/vj115 check the url for code. What i am trying to do is filter a collection by get method (from url ofcourse) But only it only works when Input::get('category') has value else nothing works. Could you please check the code and let me know what need to be fixed? Thanks. ===== Real Code just incase the link is broken in future (edited)============= public function anyIndex() { $id = Input::get('id');

laravel 4 setting base url to /subfolder

和自甴很熟 提交于 2019-12-11 03:35:44
问题 I have deploy my laravel project in a subfolder following this link I have done fine. It works fine when I write url in browser like www.myproject.com/myurl Problem is when i click any link from my project it makes request to www.myproject.com and get error. What can I do now to make www.myproject.com/myurl my base url that whenever any request made, it goes through it? 来源: https://stackoverflow.com/questions/30684866/laravel-4-setting-base-url-to-subfolder

Laravel4: Will not using the repository pattern hurt my project in the long run?

落爺英雄遲暮 提交于 2019-12-11 03:24:26
问题 I'm reading Taylor Otwell's book in which he suggests using the repository pattern. I get the theory behind it. That it's easy to switch implementations and decouples your code. I get the code too. And it is very nice to be able to switch by App::bind() with some other implementation. But I've been thinking for the last two hours how I should approach things for a new CRM I'm building. Almost no code yet but it might end up big. I would prefer to simply use eloquent models and collection