Tag:laravel

  • Hide API fields dynamically in laravel

    Time:2019-12-9

    The article was forwarded from the professional laravel developer community. Original link: https://learnku.com/laravel/t I recently saw a problem in the laravel Brasil community that turned out to be more interesting than it seemed. Imagine you have aUsersResourceUse the following implementation: <?php namespace App\Http\Resources; use Illuminate\Http\Resources\Json\Resource; class UsersResource extends Resource { /** * Transform the resource […]

  • Use laravel’s API resource capabilities to build your API

    Time:2019-12-9

    The article is forwarded to the professional laravel developer community. Original link: https://learnku.com/laravel/t In the past two years, I have been using fractal for API development. If there is one function that I most hope laravel can add, it is undoubtedly convenient for data conversion, so as to develop better API interface. Don’t get me […]

  • Online list – 20 laravel application performance optimization items

    Time:2019-12-8

    The article was forwarded from the professional laravel developer community. Original link: https://learnku.com/laravel/t Let’s start! If your laravel application is already in production. From the first user, to the tenth, the hundredth, to thousands of users! Slowly,As more users, your website will be slower and slower So what should we do?Details determine success or failure […]

  • Database filler (supplied by laravel)

    Time:2019-12-7

    //Write filler, CMD goes to project root PHP artican make: seeder userstableseeder // all frame generated fillers are in database / seeds //The stuffer class by default contains only one method: run. This method is called when the artisan command DB: seed runs. //Test add single <?php use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; class DatabaseSeeder extends Seeder […]

  • On laravel

    Time:2019-12-6

    Introduction Over the past three years, I have been exposed to four PHP frameworks, namelytp3.2 , phalcon3.2, yii2As well aslaravel5.4,Among them, Phalcon 3.2 has more contacts with laravel 5.4. Recently, a framework of planning has been deepened, which is preferredIt’s laravel laravelKnown as the most elegant PHP framework, PHP has been named the best in […]

  • Building real-time application with laravel echo server

    Time:2019-12-4

    The article was forwarded from the professional laravel developer community. Original link: https://learnku.com/laravel/t In my opinion, real-time communication is the future of APP application. Socket services are usually not that easy to implement, but the laravel echo service changes that. In this article, I will briefly introduce how to build a running socket service and […]

  • Simple example of route management of laravel framework

    Time:2019-12-4

    An example of this paper describes the route management of laravel framework. To share with you for your reference, as follows: Output view in route Route::get(‘/’, function () { return view(‘welcome’); }); Get route request Route::get(‘get’,function(){ Return ‘get route request’; }); Post route request Route::post(‘post’,function(){ Return ‘post request’; }); Multi route request Route::match([‘get’,’post’],’match’,function(){ Return ‘multi […]

  • Docker deployment of laravel application – Basic Application

    Time:2019-12-3

    Version statement This article uses php basic image:php:7.3-apache The laravel version of this article is:laravel:5.8.* I. prepare our laravel application #Run the mix command to package JS, CSS and img files. If you don’t use mix, you can omit this step npm install npm run production #Install dependencies in composer.lock composer install –ignore-platform-reqs –optimize-autoloader –no-dev […]

  • Gorose version 2.0 of golang ORM officially released

    Time:2019-12-3

    About gorose 2.0 Gorose, the most popular golang ORM, and the PHP version of laravel eloquentAfter several months of refactoring and polishing, plus nearly a month of preview testing and improvement, the official version of gorose 2.0 finally met usMajor changes and upgrades have been made in the new version, which completely reconstructs the infrastructure […]

  • The creation of laravel framework model and the example of model to data operation

    Time:2019-12-3

    An example of this paper describes the creation of laravel framework model and the data operation of the model. To share with you for your reference, as follows: Model creation: <?php namespace App; use Illuminate\Database\Eloquent\Model; class Admin extends Model{ //Specify table name protected $table = ‘wd_user’; //Specify the fields that allow bulk copying protected $fillable […]

  • Laravel validator implements joint index uniqueness of two or more fields

    Time:2019-12-1

    The validation of laravel is still very easy to use. Using validator can easily validate forms. It provides unique verification, but only one field can be verified by default. How can we achieve the uniqueness of complex conditions when encountering the joint index of two or more fields The implementation of validator’s complex uniqueness We […]

  • Recommend six little-known composer commands

    Time:2019-11-30

    The article was forwarded from the professional laravel developer community. Original link: https://learnku.com/laravel/t Composer is a dependency management tool for PHP. If you are a PHP developer, you are likely to use it every day and run commands frequentlyrequire, installSumupdate。 You may not realize that we can use some other composer commands to make it easier […]