Questions tagged as 'laravel-5'

3
answers

As valid, with laravel, that a field is only numeric?

I have tried with what appears in the documentation of laravel, but it does not help me this is my code: 'cedula' => 'numeric|required|unique:personas|min:6|max:8', This way, if I put letters, it says: "cedula must be numeric."...
asked by 18.11.2016 / 01:41
4
answers

Can a query be made in larvael where the two conditions are met where to make the query?

I need to make a query where both where are fulfilled, in this case that as long as user X and the status is PUBLISHED or DRAFT shows it, I currently have: $properties = Accommodation::where("user_id", $id)...
asked by 22.12.2018 / 18:29
2
answers

Store row in variable

You see, let's imagine that we have a table called Type and imagine that I want to get only the element with value of% co_of% of 3. In that case, I would use this: $tipo=Tipo::where('id',3)->get(); This would return a vector of a single...
asked by 17.11.2018 / 13:53
1
answer

The server requested authentication method unknown to the client [caching_sha2_password]

I have installed MySQL 8 and Laravel 5.6.18; when I try to execute the migrations with: php artisan migrate An example of my migrations is: Schema::create('categories', function (Blueprint $table) { $table->increments(...
asked by 15.05.2018 / 16:06
2
answers

I want to get only the date of my BD record from the column 'created_at'

How can I format the 'created_at' ('Y-m-d') column in the laravel driver? Since it shows me "2018-02-10 00:00:00" I have this query BD::select('created_at') shows me "2018-02-10 00:00:00"     
asked by 03.10.2018 / 00:55
1
answer

Join in laravel

I have my in my controller: $habitaciones = DB::table('habitaciones') ->join('tipo_habitaciones', 'habitaciones.id_tipo', '=', 'tipo_habitaciones.id') ->select('habitaciones.*', 'habitaciones.id', 'habitaciones.hab_numero...
asked by 01.03.2018 / 23:52
3
answers

Inquiry about Laravel and Eloquent

I have a form with two select and two date fields, when I click on the button it makes me a query with the value of the two select and "whereBetween" between the dates, is there any way of doing that I only consult according to the select in tho...
asked by 14.02.2018 / 13:18
2
answers

Translation sql to eloquent Laravel

Does anyone know how I can translate this query to eloquen? select distinct usuario_ad from usuarios where asignacion='null';     
asked by 24.10.2018 / 04:04
1
answer

Can I use several requests in a laravel 5.3 mutators?

I try to save two input in database and I was thinking about doing it with mutators, the fact is that if I modify a field I only manage that value because the $ value that I receive is the one that sends the request, but I need to use something...
asked by 06.04.2018 / 16:29
3
answers

Laravel 5.4 localhost: 8000 does not work

At the moment of putting php artisan serve everything is fine, until I address my localhost:8000 and it shows me the following: Warning: require_once(C:\xampp\htdocs\EEPAT/public/index.php): failed to open stream: No such file o...
asked by 04.07.2017 / 23:49