php – Laravel does not recognize a class

Guys, I created a file UserService.php and he has the class UserServiceHowever, Laravel does not recognize this class with the following error message:

error: Class App Services UserService does not exist

Class:

 repository = $repository;
      $this -> validator  = $validator;
    }

    public function store($data)
    {
      try
      {
        $this->validator->with($data)->passesOrFail(ValidatorInterface::RULE_CREATE);
        $usuario = this->repository->create($data);
        return (
          'sucess' => true,
          'message' => 'Usuário cadastrado!'
        )
      } catch (Exception $e)
      {
        return (
          'sucess' => false,
          'message' => 'Erro ao executar o cadastro!'
        )
      }

    }
    public function update(){}
    public function delete(){}
}

The code where I call the class:

repository = $repository;
      $this->service    = $service;
    }

    public function store(UserRequest $request)
    {
      $request = $this->service->store($request->all());

      if($request('success'))
          $usuario = $request('data');
      else
        $usuario - null;


      return view('user.idex', ('usuario' => $usuario));
    }

    public function index()
    {
      return view('user.index');
    }
}

laravel – Yajra DataTables orderColumn in eloquent does not work

I am using Yajra DataTables in my Laravel 7 project. I have a problem with the orderColumn API. Here my code:

return Datatables::eloquent(Company::query())
        ->orderColumn('name', '`column` $1')
        ->make();

But the generated query is:

select * from `companies` where `companies`.`deleted_at` is null order by `id` asc limit 10 offset 0

Can anybody help me?

pagination – Paging many-to-many relationships in laravel

I have two tables, one for video and the other for tag, their relationship is many to many, when I access the video view, all their tags are listed. When clicking on a tag, it directs me to another view where They list all the videos with that tag, assuming that in the future the application will grow, the view will fill with results, my intention is to paginate those results, and tried in various ways without obtaining a result, I would greatly appreciate your help.

Here the controller

    public function TagShow($slug){

        $videoTag = Tag::select('tags.*')
            ->where('slug','=', $slug)
            ->firstOrFail();

        return view('front.TagShow', compact('videoTag'));

    }

here the view where I do a foreach and show the logs of the bd

@foreach ($ videoTag-> videos as $ video)
picture)}} "class =" img "alt =" {{$ video-> name}} ">

Laravel in hosting only works at home

I followed a tutorial where laravel folders go outside of public_html and make changes from public_html / index.php to

require __DIR__.'/../projeto/vendor/autoload.php';

$app = require_once __DIR__.'/../projeto/bootstrap/app.php';

and the project / server.php for

    if ($uri !== '/' && file_exists(__DIR__.'/../public_html'.$uri)) {
    return false;
}

require_once __DIR__.'/../public_html/index.php';

Meusite.com/ works but if I put Meusite.com/login from error 404, what am I doing wrong?

my folder format is like this
-draft
–app
–boostrap
-public_html
–css
–img
–js
I appreciate in advance

Is it possible to make this type of relationship with Laravel?

My result with this type of schema was: JSON image
I could not include the description of Area in this professional and specialized relationship.

Here is the diagram of the tables: SQL diagram

Can anyone give me a tip?

php – mask entries with html laravel colletive?

Could anyone tell me how to put masks on posts like that using laravel collective html?

@extends (& # 39; designs.base & # 39;)

@section (& # 39; subtitle & # 39 ;, & # 39; Add Sales & # 39;)

@section (& # 39; title & # 39 ;, & # 39; Add sales & # 39;)

@section (& # 39; letter & # 39 ;, & # 39; & # 39;)

@section (& # 39; content & # 39;)
@if (session () -> has (& # 39; message_success & # 39;))

Well done! {{session () -> get (& # 39; message_success & # 39;)}}

@elseif (session () -> has (& # 39; message_danger & # 39;))

Danger! {{session () -> get (& # 39; message_danger & # 39;)}}

@end if

{{Form :: open ((& # 39; route & # 39; => & # 39; processStoreSale & # 39;))}}

{{Form :: label (& # 39; name & # 39 ;, & # 39; Name & # 39;)}}

{{Form :: text (& # 39; name & # 39 ;, null, (& # 39; class & # 39; => & # 39; form-control & # 39 ;, & # 39; placeholder & # 39;
=> Application Traits Language :: getMessage (& # 39; messages.InputText & # 39;))}}}

{{Form :: label (& # 39; product_id & # 39 ;, & # 39; Assign product & # 39;)}}

{{Form :: select (& # 39; product_id & # 39 ;, $ dataOfProducts, null, (& # 39; class & # 39; =>
& # 39; form control & # 39 ;, & # 39; placeholder & # 39;
=> Application Traits Language :: getMessage (& # 39; messages.InputText & # 39;))}}}

{{Form :: label (& # 39; quantity & # 39 ;, & # 39; Quantity & # 39;)}}

{{Form :: text (& # 39; quantity & # 39 ;, null, (& # 39; class & # 39; => & # 39; form-control & # 39 ;,
& # 39; placeholder & # 39;
=> Application Traits Language :: getMessage (& # 39; messages.InputText & # 39;))}}}

{{Form :: label (& # 39; date_of_payment & # 39 ;, & # 39; Date of payment & # 39;)}}

{{Form :: date (& # 39; date_of_payment & # 39 ;, Carbon Carbon :: now (), (& # 39; class & # 39; => & # 39; form-control & # 39 ;, & # 39; required & # 39 ;, & # 39; placeholder & # 39; => App Traits Language :: getMessage (& # 39; messages.InputText & # 39;)))}}

{{Form :: label (& # 39; price & # 39 ;, & # 39; Price & # 39;)}}

{{Form :: text (& # 39; price & # 39 ;, null, (& # 39; class & # 39; => & # 39; form-control & # 39 ;, & # 39; placeholder & # 39; => App Traits Language :: getMessage (& # 39; messages.InputText & # 39;)))}}

{{Form :: submit (& # 39; Add Sales & # 39 ;, (& # 39; class & # 39; => & # 39; btn btn-primary & # 39;))}}

{{Form :: close ()}}

$ (document) .ready (function () {
// create formValidator object
// there are many configuration options to be passed,
// but this makes it extremely flexible and does not make assumptions
val validator = new formValidator ({
// this function adds an error message to a form field
addError: function (field, message) {
// get the existing error message field
var error_message_field = $ (& # 39 ;. error_message & # 39 ;, field.parent (& # 39 ;. input-group & # 39;));

                    //if the error message field doesn't exist yet, add it
                    if (!error_message_field.length) {
                        error_message_field = $('').addClass('error_message');
                        field.parent('.input-group').append(error_message_field);
                    }

                    error_message_field.text(message).show(200);
                    field.addClass('error');
                },
                //this removes an error from a form field
                removeError: function (field) {
                    $('.error_message', field.parent('.input-row')).text('').hide();
                    field.removeClass('error');
                },
                //this is a final callback after failing to validate one or more fields
                //it can be used to display a summary message, scroll to the first error, etc.
                onErrors: function (errors, event) {
                    //errors is an array of objects, each containing a 'field' and 'message' parameter
                },
                //this defines the actual validation rules
                rules: {
                    //this is a basic non-empty check
                    'name': {
                        'field': $('input(name=name)'),
                        'validate': function (field, event) {
                            if (!field.val()) {
                                throw "A name is required.";
                            }
                        }
                    },
                    'quantity': {
                        'field': $('input(name=quantity)'),
                        'validate': function (field, event) {
                            if (!field.val()) {
                                throw "A quantity is required.";
                            }
                        }
                    },
                    'date_of_payment': {
                        'field': $('input(name=date_of_payment)'),
                        'validate': function (field, event) {
                            if (!field.val()) {
                                throw "A date_of_payment is required.";
                            }
                        }
                    }
                }
            });

            //now, we attach events

            //this does validation every time a field loses focus
            $('form').on('blur', 'input,select', function () {
                validator.validateField($(this).attr('name'), 'blur');
            });

            //this clears errors every time a field gains focus
            $('form').on('focus', 'input,select', function () {
                validator.clearError($(this).attr('name'));
            });

            //this is for the validate links
            $('.validate_section').click(function () {
                var fields = ();
                $('input,select', $(this).closest('.section')).each(function () {
                    fields.push($(this).attr('name'));
                });

                if (validator.validateFields(fields, 'submit')) {
                    alert('success');
                }
                return false;
            });
            $('.validate_form').click(function () {
                if (!validator.validateFields('submit')) {
                    return false;
                }
                return true;
            });

            //this is for the clear links
            $('.clear_section').click(function () {
                var fields = ();
                $('input,select', $(this).closest('.section')).each(function () {
                    fields.push($(this).attr('name'));
                });

                validator.clearErrors(fields);
                return false;
            });
        });
    

@endsection

Help anyone who is good at laravel: Undefined scrolling: 2

@foreach($exams as $exam) 
**@foreach($mark_details($subject->id)($exam->exam_id) as $md)**
   @php 
   $row_total = $row_total + $md->mark_value; 
   $point = get_point($row_total/count($exams)); 
   $grade = get_grade($row_total/count($exams)); 
   @endphp
   {{ $md->mark_value }}
   @endforeach     
 @php $total_subject++  @endphp    

@endforeach

swagger ui – Laravel: Fetching Post request data using SwaggerUI

I am using Swagger with laravel 7 and I want to make a Post request where I get an API parameter, but the result returns an empty array "()".

This is my controller method

 /**
 * 
 * @OAPost(
 *     path="/api/auth/register",
 *     @OAResponse(response="200", description="Getting Data from a user."),
  *    @OAParameter(
 *     name="name",
 *     in="path",
 *     description="User Name",
 *     required=true,
 *   ),
 * )
 *
*/
public function register(Request $request)
{
    $credentials = $request->only('name');
    return $credentials;
}

How to get API data and also how to add headers to request?
Thanks in advance

Integrate Laravel and Mercadopago – Stack Overflow in Spanish

I'm trying to integrate mercadopago with laravel, but I don't know how to call Mercadopago functions from Laravel, add

use MercadoPagoItem;
use MercadoPagoMerchantOrder;
use MercadoPagoPayer;
use MercadoPagoPayment;
use MercadoPagoPreference;
use MercadoPagoSDK;

and then in the code

MercadoPagoSDK::setAccessToken("ENV_ACCESS_TOKEN");

but Mercadopago SDK doesn't recognize me, I already installed doing composer require "mercadopago / dx-php"

Any idea what I have to do?

incompatibility between laravel 7 and hyn / multi-tenant

I am trying to install the hyn / multi-tenant library in laravel 7, as the requirements indicate so. But I get this error.
image
this is my composer.json
image
if someone has already passed you how did you solve it? or is it an internal library error?

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123