laravel-5.1

Call to undefined method Illuminate\Support\Facades\Validator::resolver()

眉间皱痕 提交于 2019-12-13 11:12:21
问题 What is it about ? I am using Laravel 5.2 and update the composer by running the following command composer require felixkiss/uniquewith-validator:2.* and then added the following to your providers array in config/app.php: 'providers' => array( // ... 'Felixkiss\UniqueWithValidator\UniqueWithValidatorServiceProvider', ), I did this because I am trying to implement Multiple column Unique Validation. I mean Composite Key Validation. I am following the instructions as mentioned here What's the

How to declare the table name dynamically in Laravel 5

本秂侑毒 提交于 2019-12-13 09:25:41
问题 I have to create the tables dynamically, so i need to declare the table name from controller. I need to access the variable in model like below : use Illuminate\Database\Eloquent\Model; class Transation extends Model { protected $table = 'Trans' . $this->userId; } How can i pass the variable to model? 回答1: This works, but I don't know if it is the "laravel" way: Transaction.php public function __construct($params=array()) { if (isset($params['table'])) { $this->table = $params['table']; } }

where does a library like Fractal belong?

三世轮回 提交于 2019-12-13 08:49:54
问题 I was looking into Fractal (tldr : data object/collection to json formatting library) today and saw some benefits to using it. However it's functionality seems to span across multiple layers of the app I'm working on. Hence a question appeared -- where does a code utilising Fractal belong to? Model, service, controller, some other place? The examples given in the documentation at the project docs seem to favour putting it in the controller or right in a route callback (more complex examples

Updating Larael from 5.1.35 to 5.2.* - fails to upgrade symfony/css-selector

别说谁变了你拦得住时间么 提交于 2019-12-13 08:36:32
问题 I am trying to upgrade Laravel 5.1.35 to Laravel 5.2 and I am getting the following error: Problem 1 - laravel/framework v5.1.35 requires symfony/css-selector 2.7.* -> satisfiable by symfony/css-selector[2.7.x-dev, v2.7.0, v2.7.0-BETA1, v2.7.0-BETA2, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9] but these conflict with your requirements or minimum-stability. - Conclusion: don't install laravel/framework

Laravel 5.1 Background Task that Queries Database Fails to Work when hooked to an Azure Web Job

匆匆过客 提交于 2019-12-13 08:26:04
问题 I am having a strange problem using WebJobs on Azure to run Laravel Background tasks. I have this code in my Laravel ExpireContactsFromDatabase command's handle() method public function handle() { * Update contacts that are old and past their expiry date but that have not been deleted * Set their deleted at to the current timestamp */ $contact = Contact::where('expiry_date', '<=', date('Y-m-d H:i:s')) ->whereNull('deleted_at') ->update(array('deleted_at' => date('Y-m-d H:i:s'))); Log::info(

Send Form for create with AJAX and Laravel 5.1

醉酒当歌 提交于 2019-12-13 05:57:32
问题 I'm developing an application with Laravel 5.1 and I have a problem when sending ajax petition I have the next code: View for Create: {!!Form::open()!!} <div class="form-group"> {!!Form::label('genero','Genre:')!!} {!!Form::text('genre',null,['id'=> 'genre','class'=>'form-control'])!!} </div> {!!link_to('#', $title = 'Create', $attributes = ['id'=> 'create','class'=>'btn btn-primary'], $secure = null)!!} {!!Form::close()!!} Ajax Petition: $("#create").click(function(){ var genre = $("#genre")

Running DreamFactory 2.0 on BlueMix

微笑、不失礼 提交于 2019-12-13 05:37:18
问题 I am trying to get DreamFactory 2.0 running on BlueMix. I have followed the instructions found at https://developer.ibm.com/bluemix/2014/06/17/getting-started-laravel-bluemix/ on running Laravel applications on BlueMix. I have everything under htdocs except for .bp-config, .cfignore, manifest.yml and composer.json. I have modified the path to artisan for all the scripts in composer.json and then did cf push df2 In the log messages, I see the php buildpack getting installed, all the modules

Laravel 5.1 migration new table not working

主宰稳场 提交于 2019-12-13 05:21:57
问题 I have got some problem with migration. I create new migrate file php artisan make:migration create_menu_table --create=menu then i edit the new Migration file and when i try migrate it's not working I tried: php artisan migrate php artisan migrate --force php artisan migrate:refresh php artisan migrate:refresh --seed php artisan migrate:rollback php artisan migrate:reset but they do not add created table I do not have any errors Thanks for help 回答1: Run composer dumpautoload and then try php

XCache: cannot init in Laravel 5.1 application

烈酒焚心 提交于 2019-12-13 05:07:13
问题 I'm developing a Laravel 5.1 web application. The application is working absolutely fine on my localhost but when I deploy the website on a cPanel shared hosting it get following error. FatalErrorException in Unknown line 0: XCache: Cannot init in Unknown line 0 Sometimes, this error disappears by reloading the page but appears again after reloading several times. I've tried disabling the XCache by editing the .htaccess file as described in this link but it stills generates the same error.

assertRedirectedToRoute not working in Laravel 5.1

坚强是说给别人听的谎言 提交于 2019-12-13 04:47:54
问题 Controller code: return redirect()->route('admin.patient.edit', $patientId); Test code: $this->visit(route('admin.patient.edit', $this->patient->id)) ->press('Update'); $this->assertRedirectedToRoute('admin.patient.edit', [$this->patient->id]); The error I get is this: Failed asserting that Illuminate\Http\Response Object (...) is an instance of class "Illuminate\Http\RedirectResponse". I've printed out the response from the inside the test and inside the controller and it is in fact a