Questions tagged as 'php'

1
answer

Can a Repository extend a Model?

If the Repository extends to Model User, am I breaking some of the principles of S.O.L.I.D? I've seen some tutorials talk, that I have to create an abstract class with the same methods as Eloquent, does not that apply to KISS principles? A...
asked by 07.06.2017 / 21:00
1
answer

Select model methods in the Laravel controller index method?

I have an index method that fetches all events in the database and shows them in a table Model Event: namespace App\Models; use Illuminate\Database\Eloquent\Model; class Event extends Model { protected $fillable = [ 'ti...
asked by 14.08.2017 / 00:10
2
answers

Check if email is registered in the DB

I'm doing a search in my DB to check for email, avoiding the registration of it again, but I'm having a problem with the return, the script below sends and treats the return. if (sender.getFieldName() == 'Email') { if (sender.getValue()) {...
asked by 10.08.2017 / 20:26
1
answer

Required_if with more than one field in Laravel 5.3

I have the following situation: I want a field to be mandatory only if the other two are null , if one of the other two is not null this field is no longer mandatory. I thought about using required_if , but I believe that i...
asked by 05.02.2017 / 19:17
1
answer

Is it possible to know the number of lines that a text occupies in a p?

I need this for some conditional loops, but I have no idea how to do it, or if it's possible. Assuming I have a string , and I need to know how many rows it would occupy in a given paragraph ( <p> ), only that can not be com...
asked by 01.02.2017 / 00:16
1
answer

How to make an http request with php with authentication and waiting for a file in response?

I'm using a Text to Speech service and would like to use it in a php that I'm riding. The problem is that I have never done this before and I do not even know where to start. This type of information is provided in the documentation GET...
asked by 17.02.2017 / 15:17
3
answers

Html + Css creation of frequently asked questions

Good afternoon, I started shortly to evolve my html + css for creating web pages will anyone be able to give me a hint how to do what is requested in the image below? . Basically when we click on the area where the arrow in the right corner...
asked by 05.12.2016 / 19:20
2
answers

Error PHP POO Polymorphism

When developing a simple PHP POO application, I came across an unexpected error, and I have no idea why. I'm now starting to study object-oriented programming and I only have a small base in C #. The program itself is simple: two classes (...
asked by 19.10.2017 / 06:27
1
answer

Compare performance of two PHP script

I worked on a PHP script, later I found it too complex and cumbersome and felt the need to simplify it. I've deleted some unnecessary functions; I have simplified some parts of the code repeated in functions; I chose POO to make the sc...
asked by 17.12.2016 / 16:39
2
answers

DOMXpath query with multiple classes

I'm performing a parse on a html file with the following structure: <div class="lstImv blackBd12"> <div class="stCl3 stLeft imvImg"> <div class="imgBox"> <a class="emp-imgs-link"&...
asked by 06.12.2016 / 05:40