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
0
votes
1 answer

Laravel 7.2, composer install, don't install xethron/migrations-generator

I want to create a migration from existing database in Laravel 7.2. I found xethron/migrations-generator in this link. When I tried to install it I got this error: Problem 1 - xethron/migrations-generator v2.0.0 requires way/generators…
0
votes
2 answers

laravel7, is there mindmap for login process?

I am creating my first package with Laravel 7. Idea is make login and register process inside it. Login and Register forms are working, and process logic work aswell. When I am calling them from route-file directly Blade form. But I have…
MikroMike
  • 45
  • 7
0
votes
2 answers

How to conditionally validate an array input in Laravel 7?

I am trying to conditionally validate an array input in Laravel. I am following the documentation provided here. But the documentation does not provide details on how to do it on an array input. Below is the code that I am trying $rule = [ …
Akhilesh
  • 1,243
  • 4
  • 16
  • 49
0
votes
1 answer

Using old() in Laravel

I have below code How to know old() is empty here ?
abu abu
  • 6,599
  • 19
  • 74
  • 131
0
votes
1 answer

stream_socket_enable_crypto(): SSL operation failed with code 1 - Laravel 7

I am trying to use Google's SMTP server to send emails from my Laravel 7.x application. The config settings I am using are copied from my other working Laravel apps (with credentials changed). My Gsuite account has 2-step verification enabled and I…
hackernewbie
  • 1,606
  • 20
  • 13
0
votes
1 answer

Laravel 7- Authorize access to registration page with querystring

I need to implement something particular for registration page. I send to users a link like this: https://mywebsite.com/register?id=123456789 Then, i check to my database if the ID exists, and if not, i want to redirect the user to another page,…
pasluc74669
  • 1,680
  • 2
  • 25
  • 53
0
votes
0 answers

Undo rollback in laravel 7

I have called rollback in laravel 7 by mistake and my table is gone. Is there any way to bring my table back? I had written php artisan migrate:rollback
Xyed Xain Haider
  • 488
  • 4
  • 16
0
votes
1 answer

Laravel 7 User $user is not retrieving data

guys! I have got some problems. I have User and Page is kinda info about the user like Profile. I have created User(using php artisan ui bootstrap --auth) and PageController and Page (controller, model php artisan make:model and controller) I have…
Murod
  • 22
  • 1
  • 6
0
votes
3 answers

Laravel I want to display only employees in table

Hi I'm building a human resources management system, I want to display only users that are not admin in a data table but I'm getting error dont know what I might be doing wrong. Here is my code; …
kris7i
  • 71
  • 2
  • 11
0
votes
1 answer

Can multiple queries be applied to a model in Laravel?

I'm currently trying to get data from the DB with a Laravel controller through a model Maintain. Is there a way to query the DB based on the request data made by an axios post from the front end, this includes both variables sub and zone, I have the…
Adam_R
  • 37
  • 2
  • 12
0
votes
1 answer

Laravel route undefined but it is clearly defined

I am having problems getting some routes to work. I have clearly declared some routes that just don't show up in php artisan route:list, even after clearing the cache. Since I think this may be related to another line not being correct, I have…
nepp95
  • 131
  • 1
  • 13
0
votes
1 answer

Laravel - Missing required parameters for Route

I have a problem with my routes in Laravel 7 not sure where I a, going wrong here. I have this route declaration: Route::group(['prefix'=>'config', 'namespace'=>'Config'], static function () { Route::resource('id-generation',…
FreddCha
  • 465
  • 2
  • 8
  • 15
0
votes
2 answers

Column not found 1054 error when defining laravel relationship

I have two tables: Order and Order_details. Between these two tables, there is a one-to-many relationship. Order fields are: id_order invoice customer_id user_id total Order_details…
Vinotaz
  • 55
  • 8
0
votes
2 answers

Custom validation rule with request class not working laravel 7

Below is my code; FruitRequest.php class FruitRequest extends Request { public function authorize() { return true; } public function rules() { return [ 'name' => 'required|alpha', 'image' =>…
Vishal Vaishnav
  • 3,346
  • 3
  • 26
  • 57
0
votes
2 answers

Stop users from accessing guest pages after login in Laravel 7

Is there any way to stop the users from accessing guest pages after they've logged in? I tried using the guest middleware bt nothing happens. I have two sets of guards: RESTAURANT and CUSTOMERS. Once the customer has logged in I don't want them to…
A.K.S
  • 97
  • 1
  • 4
  • 14
1 2 3
99
100