Questions tagged as 'laravel'

1
answer

Laravel - Return HTML or JSON in same Method

I'm starting with Laravel, seeing from the rails, where to return a JSON I simply put .json in the url, obviously the return handling is on the Controller. My question is how to do something like Laravel. I would like, instead of creating a m...
asked by 13.03.2016 / 21:21
2
answers

Catch All Records and Separate by Status

Dealer.php class Dealer extends Model { # Relacionamento com Medalhas public function dealer_medalhas(){ return $this->hasMany('App\DealerMedal', 'id_concessionaria'); } } DealerMedal.php class DealerMedal extends...
asked by 15.03.2016 / 20:31
2
answers

Write to two different tables using the same View

I'm doing a supplier registration, and I need to record it in one table and its address in another. I use a single view vendors.blade to fill in all the data. How can I separate this data to write them to their respective tables? Suppliers...
asked by 07.09.2015 / 00:22
1
answer

Generate token from string and check generated token

Basically, I need something that works similar to $hash = Hash::make('string') and Hash::check('string', $hash) but does not produce a result as large as (60 characters).    or $hash = password_hash('string') and passw...
asked by 14.08.2015 / 19:08
2
answers

How to publish multiple Laravel applications on Shared Server?

I have two independent applications made in Laravel I would like to host them on the same server, in separate directories. I searched extensively in the documentation and forums, and managed to make only one application work correctly, howeve...
asked by 19.02.2016 / 21:23
1
answer

Why should I use File :: copy, if PHP already exists copy?

I'm using Laravel on various projects I use. I needed to copy a particular file from one location to another, and I saw in the Laravel documentation that I should use File::copy() . Out of curiosity, as I always do, I decide...
asked by 06.07.2015 / 18:34
1
answer

How to update the pivot in LARAVEL 4 using the UPDATE method?

I have two Models that are linked, through belongsToMany , to a relationship table N: N. So the structure is arranged as follows: classPermissaoextendsEloquent{publicfunctionniveis(){return$this->belongsToMany('Nivel','niveis_perm...
asked by 10.06.2015 / 14:29
1
answer

What is a scope for in Laravel?

I saw in the documentation of Laravel an explanation about the use of Eloquent. There I saw a part where you talk about Local and Global Scopes . As I do not speak much English, I had some doubts about using it. What are these methods w...
asked by 24.08.2016 / 15:25
1
answer

Read and write xlsm file in php

I have a fairly large hand problem which is as follows: I have an xlsm file with macros to read, write, and then download. It is a 4 MB file with formatting and embedded images. I have used PHPExcel just because I have not been able to rea...
asked by 13.04.2015 / 12:24
1
answer

Can the controller send email?

In a controller called activities, I have a method called reminder. This method, receives an id, searches for that activity based on this id and sends an email to the moderator of that activity with data of the same. Is this method with 'too muc...
asked by 06.12.2014 / 20:05