laravel

How to make a LOGIN in laravel for two fields

According to the standard in laravel, there is one field for username when logging in to the account. Here is for example now ... database) and log in to the account was successful. If this cannot be done then suggest an alternative two-field entry option

Laravel echo pusher does not listen to the channel front part of vue.What could be the problem

****Created an event when creating a new message record** <?php namespace App\Events; use Illuminate\Broadcasting\Channe ... p') console.log(e); }); } //console.log(text) } },

How to properly connect js files in laravel?

Please tell me how do I properly connect js in laravel? Previously, the code was in a single file app.js. I started sorting t ... page and various errors are thrown into the console. This page should not know anything at all about js which is in errors

Laravel and the architecture for the Rest API

Good time of day! I am writing a service in Laravel, in which I use only API requests. There were some questions, since I pre ... d perform data validation inside this class. How do I return an error in my error return option in case of validation errors?

Configuring nginx for laravel

Good afternoon, I'm trying to configure laravel for nginx, nothing comes out. Config: server { listen 80; server_name ... change to an IP address with a port - it does not help. Looked with netstat -lnxp, finds the socket - var/run/php5-fpm.sock.

Laravel 8 OpenServer curl error 60 installation error

I'm trying to install laravel 8 on OpenServer (PHP 7.4) via Composer (The latest version of Composer 2.0.8 is available) Befo ... official site it is not mentioned anywhere, and there is no such thing in the tutorials. Or do I understand something wrong ?

How do I access the functions of neighboring models? Laravel

Hello everyone, please tell me how to properly access the functions of neighboring models? initially, I had all the functions ... $endDate); return view('timetable', compact('holidays', 'user', 'countUser', 'parties', 'calculate')); } }

Why does Laravel give an error when migrating from a foreign key?

When migrating (php artisan migrate) with a foreign-key, an error occurs: SQLSTATE[HY000]: General error: 1005 Can't crea ... he same migration and there are no errors. How to solve the problem with this a mistake? UPD: users table cities table

CORS error when accessing the API on Laravel 7

I wrote a simple API for a home project and uploaded it under the domain api.anaxita.ru , but the following problem occurred ... ccessfully get the code 200. I ask for your advice. The token specified in the request is valid and can be used for requests.

Localization of VueJS components in Laravel

Laravel has a localization package that works like this (PHP): echo __('I love programming.'); And how to do the same, but ... om the localization files. UPD {{ title }} and {{ message }} are taken from attributes, this does not need to be translated.

Laravel how to link 2 tables to get the data of the first one by the id of the other table

Hello everyone. Let's say there are 2 tables - clients and payments. The client can have many payments, because here in the m ... nts of a particular client (clearly, the id characterizes a particular client). Please tell me who knows how to implement it.

Laravel Multi-level menu

You need a multi-level menu that will be output from the database. The structure is still like this. There is a common templa ... @endif </li> @endforeach </ul> </li> </ul> </div>

Angular + Laravel PHP Routing in.htaccess

Good time of day. Have some trouble. There is a website in Angular and a server in PHP (Laravel). The customer asked to re ... ixLogs')->name('admin.soap.fix'); Route::get('/postman', function () { return view('welcome'); })->name('index');

z-index does not work, what is the error, last child

Hello everyone, it is not possible to correctly insert the salad corner in the blocks, what is the problem I do not understan ... color: transparent; box-shadow: none; background-image: none; } } } }

"Target class does not exist" error in Laravel

Faced with such a problem. I created the controller via the console using artisan, everything was created successfully. Howev ... \Request; class PageController extends Controller { public function home() { return view('home'); } }

Design patterns in popular Open Source projects

Can someone give a list of common design patterns in Open Source projects ? Such as symfony or laravel ? For example, I woul ... look at the implementation of the Factory, Builder, Prototype, Adapter, Decorator, Observer, etc. patterns in these projects.

Get a list of files from the database/seed directory in Laravel?

Is there a better way to get a list of files from the database/seed directory than this: $files = array_diff(scandir(__DIR__ ... .', 'data')); Is it possible to get only php files from this directory? It's just that the data directory is already there.

Output words from a php sentence

Why when outputting words: preg_match_all('/([a-zA-Zа-яА-Я]+)/',$request->words, $word); for ($i=0; $i < count($word[ ... owing: иван РїпїЅ козел иван, РїС†, козел If I just output $request->words, then everything is fine.

How do I send cookies to Laravel middleware?

How do I send cookies directly to middleware? Option return $next($request)->cookie('switch', $sw); Does not work. Wh ... , but when I try to get cookies in some controller $request->cookie('switch') Then I get null Lara version 5.8, php 7.1

Yii2 or Laravel?

Which is better for a large project-yii or laravel? I know kohana. The choice of the framework for the new project is left to ... ything is complicated, or am I wrong? In general, we need advice on the example of personal experience. I have a week's time.