Questions tagged as 'laravel'

1
answer

How to Order Related Model Data?

I have the following relationship in my application: Template Customer : class Cliente extends Model { protected $table = 'clientes'; public function Usuario(){ return $this->hasMany('App\Models\Admin\Usuario', 'id_cli...
asked by 18.04.2016 / 15:54
1
answer

Condition in request laravel

I have a request class called PessoaRequest . In this class, I validate my registration form for people. But now, some information to be inserted appears that is not mandatory: the name of the father and the mother. When I have this inf...
asked by 18.04.2016 / 20:43
1
answer

How to bring only the latest records with Laravel 5.2

I need to return the last 10 records for a view .. return view('home.home', [ 'data' => $this->sale->get(), //aqui eu quero pegar os 10 últimos 'nav' => 'dashboard' ]); Is there any Eloquent method that does this?     
asked by 20.10.2016 / 15:59
1
answer

Is there any way to configure Laravel 4 to use namespaces?

In Laravel 5 , I noticed that they have now added namespaces in the application folder. But things were not like that in the Laravel 4 version. No Laravel 5 , for example Controllers would look like this: namespace...
asked by 13.04.2016 / 14:12
2
answers

What is the "array" option in app / config / session.php?

I know that in Laravel 4 we can configure several ways to save session data. They are the optional storage mechanisms of session. Among them, we can select memcached , database , cookie , apc and file , which by...
asked by 12.08.2015 / 16:15
2
answers

Problem with date Laravel

My problem is with date conversion, see: echo date('Y-m-d', strtotime(Input::get('data_evento'))); echo of Input::get('data_evento') : 14/02/2014 echo of date('Y-m-d', strtotime(Input::get('data_evento')))...
asked by 14.02.2014 / 18:15
1
answer

Table query with CONCAT and JOIN?

I need to get a collection as a result of querying in 3 tables using concat and join , the image below shows the relationship between them:    Itriedtousethecodebelow$teste=DB::table('clientesasc')->leftjoin('reservas...
asked by 10.07.2018 / 13:49
1
answer

What is the difference between Request :: wantsJson () and Request :: ajax ()?

In Laravelle 4, I used to use the Request::ajax() method to know and the request was an XHR. When I started using Laravel 5, I realized that I was being used more in the tutorials than Request::wantsJson() . However, I noticed th...
asked by 13.07.2018 / 17:41
1
answer

Filter with pagination - Laravel [duplicate]

Good evening, The filter itself appears right, but when you go to another page (by pagination), you lose this filter. I can not find the problem, can anyone help me? My route: Route::any('/recentes-pesquisa','ActionsRecentsControlle...
asked by 24.08.2018 / 00:41
2
answers

I can not use foreach with object twice in the same view in laravel

I have a big problem that I can not solve because I am still a beginner in Laravel. The problem is that I'm developing a web application and I need to list the cities object in two different select, however when I add the second foreach it gives...
asked by 26.10.2017 / 20:07