laravel-5.1

SQLSTATE[HY000] [2002] A connection attempt failed.. - When attempting to connect from Local to remote server

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 12:15:03
问题 env file: APP_ENV=local APP_DEBUG=true APP_KEY= ........... DB_HOST=srv3.linuxisrael.co.il DB_DATABASE= name_of_my_database DB_USERNAME=moti_winkler DB_PASSWORD=1234567890 CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null Routes.php : use App\User; Route::get('/', function(){ User::create(['first_name' => 'moti']); return view('welcome'); }); The error i get : PDOException in

gulp Cannot find module 'readable-stream/transform'

感情迁移 提交于 2019-12-24 12:01:03
问题 when I run gulp in my windows 7 I got this <pre> c:\wamp\www\laravel>gulp module.js:339 throw err; ^ Error: Cannot find module 'readable-stream/transform' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object.<anonymous> (c:\wamp\www\laravel\node_modules\laravel-elixir\node_modules\gulp-util\node_modules\through2\through2.js:1:79) at Module._compile (module.js:435:26) at

Session conflicts with multiple Laravel projects on one server

心不动则不痛 提交于 2019-12-24 11:28:35
问题 I have a shared server for several Laravel projects. Example: x.x.x.x/project1 x.x.x.x/project2 My problem is that when I try to login in project1 , project2 will automatically logout. Is it because of Laravel sessions? Could someone suggest what I should do? 回答1: The path of the session cookie is configurable. Take a look at the path key in config/session.php 回答2: This is not a session issue, but a cookie issue. You can fix APP_NAME in your .env file differently for each project. This is

Laravel Facebook Login : Error app_id is required

送分小仙女□ 提交于 2019-12-24 06:48:28
问题 I'm using laravel 5.1, I want to add facebook social login to my page, but it is returning error The parameter app_id is required routes.php Route::get('/redirect', 'UserController@redirect'); Route::get('/callback', 'UserController@callback'); UserController public function redirect(){ return Socialite::driver('facebook')->redirect(); } Composer.json "require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "laravel/socialite": "^2.0", } Config/Services.php 'facebook' => [ 'client_id' =>

Laravel Session store not set on request

此生再无相见时 提交于 2019-12-24 05:24:11
问题 I'm developing a small website and have problems with the session. When I try to login or make an AJAX call, I get the following RuntimeException: RuntimeException in Request.php line 758: Session store not set on request. in Request.php line 758 at Request->session() in VerifyCsrfToken.php line 87 at VerifyCsrfToken->tokensMatch(object(Request)) in VerifyCsrfToken.php line 49 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken),

Failure to update Laravel 5.1 to 5.2 (these conflict with your requirements or minimum-stability)

落爺英雄遲暮 提交于 2019-12-24 01:25:50
问题 Couple weeks ago I asked this question about trying to upgrade from Laravel 5.1 to 5.2 - Updating Larael from 5.1.35 to 5.2.* - fails to upgrade symfony/css-selector Although I was given very nice and clear answer, that did not help. As instructed, I have updated "lucadegasperi/oauth2-server-laravel" to "~5.1" , but I still have the same error. My composer.json { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "type

Joining Model with Table Laravel 5.2

我是研究僧i 提交于 2019-12-24 00:58:14
问题 I have created a model in Laravel. class deals extends Model { // protected $table = 'tbl_deal'; } Now I want to use this model to retrieve data in my Controller. However, the data extracted from this model also needs to be constrained by a column in another table. Below is the basic schema tbl_deal deal_id merchant_id deal_text tbl_merchant merchant_id merchant_url_text My current Controller has the following code to extract all deals from deals model. $deals = deals::all(); I want to

Laravel 5.1: Calling a function from string

懵懂的女人 提交于 2019-12-24 00:54:50
问题 Currently I'm trying to call a function from a string. This is the function, that I'll call later: <?php namespace App\Validation\Options; class FacebookOptionValidation { static public function validate() { echo: 'example'; die(); } } Here is my controller: <?php namespace App\Http\Controllers\Profile; use App\Validation\Options; class ProfileUserEditController extends Controller { public function updateUserOption() { $class = 'Options\FacebookOptionValidation'; $class::validate(); } } In

Laravel 5.1 Updated Model Relationships when Eagerly Loaded Don't Persist to Database

自古美人都是妖i 提交于 2019-12-23 22:05:48
问题 I'm updating a Rental that belongsTo a Location, and I can fill and persist the Rental data, but when I fill the location relationship data retrieved through eager loading if I try to save(), update(), or push(); It isn't persisted to the database. According to the docs push() should work as it apparently persists relationships. Update Action public function update($id, RentalUpdateRequest $request) { // Eager load the rental with relationships $Rental = Rental::with('location')->find($id); /

Laravel 5.1 use limit in with() method of eloquent

怎甘沉沦 提交于 2019-12-23 18:55:03
问题 Eloquent $staffGroup = StaffGroup::where('id', $id) ->with('staffGroupRight') ->first(); In StaffGroup Model : public function staffGroupRight() { return $this->hasMany('Modules\Staff\Http\Models\StaffGroupRight'); } what i have does is, public function staffGroupRight() { return $this->hasMany('Modules\Staff\Http\Models\StaffGroupRight')->take(5); } but it gives total 5 rows for all staff_group but i want it to limit for one staff_group For example There are 10 staff_group then it gives 5