In%%, I want, when a given value does not exist in Laravel , I can set a default value.
With pure PHP, you can do this:
$text = isset($_POST['text']) ? $_POST['text'] : 'padrão';
In Laravel I know it's possible to do something like...
I need to create a method that compares two or more arrays if the current date is greater than the due date (date_paymentX) that exists in those arrays and returns how many occurrences there are.
Method:
public function payments()
{
$da...
I'm trying to add a foreign key to this table with the following code block
public function up()
{
Schema::create('registros', function (Blueprint $table) {
$table->increments('id');
$table->integer( 'cliente' )-&g...
I have a View where in it I would like to add the link of a Controller with its Action specifies and when loading this View to Action of that Controller is triggered.
Example: within a View I...
Does anyone know how my layouts.default can load multiple views every time they are called. For example I want to call the views of the menus and the menu.blade.php file has to receive data as well.
If I'm developing a site that has an integrated API, for example, Laravel, I have a website and an API in the same project
What is the best way to feed the site?
Should I create a controller that will fetch the API information in JSON and...
I remember well when I used Laravel 4 that it was possible to globally convert the formats of created_at and updated_at , to display in JSON responses or even to the {{ $model->created_at }} direct call.
I did the follo...
I need to create an array:
array(
0 => 0,
1 => 0,
2 => 1,
3 => 0,
4 => 0,
5 => 1,
6 => 0)
within a session:
session('session_array')
and then individually add and retrieve the values according...
I answered this question here once about the subject:
Store PHP script output in HTML "compacted" .
But now I would like to know how I can do this in Laravel.
When it comes to an HTML response, how could I capture all the rendering of...
I have a manual query in my model, and I want to return to view of blade the result of this query with pagination. Is there any way?
Model
class Ticket extends Model
{
protected $fillable = [
'id',...