Questions tagged as 'laravel-5.2'

3
answers

Error while joining with Laravel's Query Builder

I'm doing the following Join: public function getStockDanger() { $data = DB::table('product') ->join('stock', 'product.id', '=', 'stock.product_id') ->where('stock.stock', '<=', 0) ->get(); return v...
asked by 07.10.2016 / 19:44
1
answer

Laravel 5.2 with pagination

I have the following function inside the controller public function home() { $igrejas = Igreja::paginate(3); $igrejas->setPath('igrejas'); return view('admin/igrejas/home')->with('igrejas', $igrejas); } I need to be return...
asked by 02.08.2016 / 20:19
3
answers

Blade default value laravel 5.2

I have the following code <strong class="primary-font">Complemento</strong> <p>{{ $produto->complemento or 'Esta produto não tem complemento' }}</p> I need the system to display the text 'This product has no compl...
asked by 02.08.2016 / 21:15
3
answers

Update record with Laravel 5.2?

I have the following function: public function alterar($id) { $produto = Produto::find($id); $params = $request->all(); $produto->fill($params)->save(); return redirect()->action('ProdutoController@index'); } how...
asked by 03.08.2016 / 23:42
1
answer

Using the php artisan make: repository command

Hello, I would like to ask a question. I am using the command: php artisan make:repository ProjectNote And I would like to know how to make the command understand that I want my migrate to have the name create_table_project_notes And t...
asked by 06.05.2016 / 21:01
1
answer

Problem with wherein Eloquent Laravel

I need to run a query with the parameters as below: $questoes = Questao::leftJoin('capitulos_questoes', 'capitulos_questoes.questoes_id', '=', 'questoes.id') ->leftJoin('modulos_questoes', 'modulos_questoes.questoes_id', '=', 'q...
asked by 24.11.2016 / 14:40
2
answers

Group items by month and count them laravel

I need to group and count all items by mês . I use Laravel 5.2 , I tried to do this: $mes = date('m'); $vendas = Encomenda::where('FlgStEncomenda', 'O') ->group("MONTH(created_at)={$mes}") ->count(); I ne...
asked by 23.11.2016 / 18:56
1
answer

Object of class Illuminate \ Database \ Eloquent \ Builder could not be converted to string. laravel 5.2

I'm having trouble with a relative search on Laravel . I give the option of several on-screen search, they are: start date end date status, and who it is But the person can search in a unitary way, for example: I want to get e...
asked by 16.11.2016 / 22:00
0
answers

Doubt too much relationship for laravel

I have the following relationship: My question comes in the programming of the order_products model, the real one would like to check if I'm doing it the right way, I programmed it like this: class EncomendaProdutos extends Model {...
asked by 22.10.2016 / 02:33
2
answers

Laravel 5.2 - Making Many To Many relationships between records of the same table

The tables: The users table registers users who can have N functions that are stored in the funcoes table (student, responsible, teacher, etc.). The funcao_user table is pivot that makes the Many To Many relationship b...
asked by 14.09.2016 / 22:34