Questions tagged [laravel-7]

Laravel 7 is the previous stable version of the open-source PHP web framework created by Taylor Otwell. It was released on March 3, 2020. Please use the [laravel] tag for general Laravel-related questions.

Laravel 7 continues the improvements made in Laravel 6.x by introducing Laravel Sanctum, routing speed improvements, custom Eloquent casts, Blade component tags, fluent string operations, a developer-focused HTTP client, first-party CORS support, improved scoping for route model binding, stub customization, database queue improvements, multiple mail drivers, query-time casts, a new artisan test command, and a variety of other bug fixes and usability improvements.


New features overview:

  • Laravel Airlock

Laravel Airlock provides a featherweight authentication system for SPAs (single-page applications), mobile applications, and simple, token-based APIs. Airlock allows each user of your application to generate multiple API tokens for their account. In addition, these tokens may be granted abilities/scopes which specify which actions the tokens are allowed to perform.

  • Custom Eloquent Casts

Laravel has various built-in, helpful cast types; however, you may occasionally need to define your cast types. You may now accomplish this by defining a class that implements the CastsAttributes interface.

Classes that implement this interface must define get and set methods. The get method is responsible for transforming a raw value from the database into a cast value, while the set method should transform a cast value into a raw value that can be stored in the database.

  • Blade Component Tags & Improvements

Blade components have been overhauled for tag-based rendering, attribute management, component classes, and inline view components. Since the overhaul of Blade components is so extensive, please consult the complete Blade component documentation to learn about this feature.

  • HTTP Client

Laravel now provides an expressive, minimal API around the Guzzle HTTP client, allowing you to quickly make outgoing HTTP requests to communicate with other web applications. Laravel’s wrapper around Guzzle is focused on its most common use cases and an excellent developer experience.

  • Route Caching Speed Improvements

Laravel 7 includes a new method of matching compiled, cached routes that have been cached using the route:cache Artisan command. On large applications (for example, applications with 800 or more routes), these improvements can result in a 2x speed improvement in requests per second on a simple “Hello World” benchmark. Again, no changes to your application are required.

2270 questions
6
votes
5 answers

Laravel 7 Fatal error: Uncaught RuntimeException: A facade root has not been set

I have looked at several answers suggested to a similar issue but nothing worked in my case. FYI, this is my first project in Laravel 7, working fine on my Mac. I have deployed the project on my server following this article. When running the…
6
votes
3 answers

Undefined type Laravel\Passport\HasApiTokens

I followed the Laravel docs to install the Passport service in Laravel. However when I want to use HasApiToken in my user model I get the error Undefined type 'Laravel\Passport\HasApiTokens'. User.php:
Johann
  • 155
  • 7
  • 15
5
votes
1 answer

Laravel WebSocket with Pusher Error when making POST Request

I'm trying to integrate web socket into my laravel project. I did all steps from here composer require pusher/pusher-php-server /Users/alpha/Sites/jdoe/config/broadcasting.php https://dashboard.pusher.com/apps/888 app_id = "888" key =…
code-8
  • 54,650
  • 106
  • 352
  • 604
5
votes
4 answers

Target class [view] does not exist. in Container.php

I have a problem with laravel and I don't know how to fix it for now. Actually I don't know how I face this problem, but will try to explain you what I did and what I tried for now to fix the problem. I tried composer update and this problem…
Plamen Penchev
  • 357
  • 1
  • 5
  • 15
5
votes
3 answers

How to resolve laravel ui in Laravel Framework 7.29.3

I am currently using laravel 7.29.3 . i want install laravel ui auth using below command composer require laravel/ui php artisan ui bootstrap --auth But its not working getting bellow respectively Problem 1 - Conclusion: remove laravel/framework…
Praful
  • 171
  • 1
  • 16
5
votes
1 answer

I get BadMethodCallException Call to undefined method App\Models\User::identifiableAttribute()

I get this error after clicking 'New Post' button the frontend of the app: Posts view Line from my log file: [2020-09-27 14:41:03] local.ERROR: Call to undefined method App\Models\User::identifiableAttribute() {"exception":"[object]…
5
votes
1 answer

how can i update database on browser window close?

I am trying to stream some videos to users and i want to enable them to resume watching a video when they leave the website and enter again. As far as i know storing the video time in browser's local storage and retrieving it when they come back is…
Arman Jelodar
  • 95
  • 1
  • 9
5
votes
1 answer

What's the correct configuration to send emails using Sendmail in Laravel?

I am using Laravel 7 and I want to send an email using the Sendemail driver via Laravel Mail facade. It worked when I used the PHP mail function but I want to use the Laravel Mail facade instead. My .env file email…
Amir
  • 473
  • 2
  • 11
  • 24
5
votes
2 answers

Class 'Form' not found in Laravel 7

I'm upgrading from Laravel 5 to Laravel 7. I'm using a lot of Form::model on my project. Class 'Form' not found I tried to install "laravelcollective/html": "~5.0" I kept getting Problem 1 - Conclusion: remove laravel/framework v7.3.0 -…
code-8
  • 54,650
  • 106
  • 352
  • 604
5
votes
1 answer

Laravel 7.1.x missing files: AuthenticatesUsers, RegistersUsers

I just upgraded from Laravel 6.x to 7.1.x and now my application is messed up due to changes. One of which is the login authentication. With the new Laravel 7.1.2, these files are gone. use Illuminate\Foundation\Auth\RegistersUsers; use…
basagabi
  • 4,900
  • 6
  • 38
  • 84
5
votes
4 answers

Is there a proper way to wire up Trix editor with Livewire?

When wiring together Trix editor content with Livewire, I am stumbling into problems. I believe that the issue is that when Livewire receives content from Trix, the content is swapped out and Trix becomes disabled. Is there a better way? What I have…
Elliot
  • 1,457
  • 13
  • 40
4
votes
0 answers

How to call MSSQL Stored Procedure with INPUT and OUTPUT parameters in laravel

I'm trying to call MSSQL stored procedure functions in my Laravel project, the procedures with only input parameters work well, but functions with input and output parameters have issues. when I call the function with only its input parameters to…
4
votes
1 answer

How to run two different versions of laravel side by side with different php versions

I have a Laravel 7 project running on my PC with PHP version 7.2.5 installed. I want to run another project of Laravel 8 with PHP version>=7.3 required. What can I do? I want to run both projects on my PC at the same time. Thank you!
hydar_akbar
  • 55
  • 1
  • 8
4
votes
0 answers

laravel gate not working in blade with @can

i create a simple gate with laravel that return true and use it in blade with @can but it not work here my gate in authserviceprovider Gate::define('isLoginSite', function ($user) { return true; }); it just return true. here my…
taher
  • 159
  • 1
  • 10
4
votes
3 answers

how to scroll to first validation error message in livewire laravel

I am new in livewire. i am working on registration process of user. Register form is quite big and validations also working fine to me. The problem is when user submits the form validations came but user not able to see because submit button is at…
kunal
  • 4,122
  • 12
  • 40
  • 75