Tag:laravel

  • Detailed explanation of form operation of laravel framework learning record

    Time:2021-9-26

    This paper describes the form operation of learning records in laravel framework. Share with you for your reference, as follows: 1. MVC data flow The most basic thing to get a laravel project is to find out how its page request and data flow are carried out. For example, when requesting the index page through […]

  • Detailed explanation of laravel framework routing and MVC examples

    Time:2021-9-25

    This paper describes the example of laravel framework routing and MVC. Share with you for your reference, as follows: 1. Routing The function of routing is to forward different URL requests of users to corresponding programs for processing. The routing of laravel is defined in the routes folder. By default, four routing files are provided, […]

  • Laravel admin uses modeltree to manage classification information

    Time:2021-9-17

    Generate model and migration files php artisan make:model Models/Shoping/Category -m app/Models/Shoping/Category.php <?php namespace App\Models\Shoping; use Encore\Admin\Traits\AdminBuilder; use Encore\Admin\Traits\ModelTree; use Illuminate\Database\Eloquent\Model; /** * * Class Category * @package App\Models\Shoping */ class Category extends Model { // use ModelTree, AdminBuilder; protected $table=”shoping_categories”; public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setTitleColumn(“name”); } } Migrate files class CreateCategoriesTable […]

  • Simple usage example of laravel framework Middleware

    Time:2021-8-26

    This paper describes the simple use of laravel framework middleware. Share with you for your reference, as follows: Laravel has a built-in middleware to verify whether the user has been authenticated. If the user has not been authenticated, the middleware will redirect the user to the login page. Otherwise, if the user has been authenticated, […]

  • Example of implementation method of laravel framework packet controller and packet routing

    Time:2021-8-25

    This paper describes the implementation of packet controller and packet routing in laravel framework. Share with you for your reference, as follows: route Route::group([‘domain’ => ‘laravel.8g.com’,’namespace’ => ‘Admin’],function() { Route::get(‘/admin/login’,’[email protected]’); Route::post(‘/admin/signin’,’[email protected]’); }); Controller (HTTP \ controllers \ admin \ logincontroller. PHP) <?php /** * Created by PhpStorm. * User: Administrator * Date: 2017/11/5 * Time: […]

  • Detailed explanation of laravel framework model and database basic operation examples

    Time:2021-8-24

    This paper describes the laravel framework model and the basic operation of database. Share with you for your reference, as follows: Laravel is divided into three major database operations (DB facade [original search], query builder [query builder], eloquent ORM): use Illuminate\Support\Facades\DB; 1. DB facade [original search] $results = DB::select(‘select * from users where id = […]

  • The laravel framework implements an example of adding a new file extension to the blade template engine

    Time:2021-8-23

    This article describes the implementation of laravel framework to add a new file extension to the blade template engine. Share with you for your reference, as follows: For some reasons, I’m going to replace the framework of blending skin with laravel (a framework built by myself before), but I encountered some problems during template migration. […]

  • Example of laravel framework custom paging style operation

    Time:2021-8-19

    This article describes the operation of user-defined paging style in laravel framework. Share with you for your reference, as follows: The operation steps are as follows: (1)   Create a paging style corresponding to the public / CSS / paging.css file (2)   The controller finds out the paging data and uses the paginate function […]

  • Component development and implementation of learning notes in laravel framework

    Time:2021-8-13

    This paper describes the component development and implementation method of learning notes in laravel framework. Share with you for your reference, as follows: 1. The first difficulty is to introduce local components into the project for development and testing, which has been solved 2. You need to publish the configuration file in the component to […]

  • Simple analysis of the implementation process and principle of laravel framework

    Time:2021-8-12

    This paper illustrates the implementation process and principle of laravel framework. Share with you for your reference, as follows: 1.index.php $app = require_once __DIR__.’/../bootstrap/app.php’; $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); 2. Enter app.php $app = new Illuminate\Foundation\Application( $_ENV[‘APP_BASE_PATH’] ?? dirname(__DIR__) ); $app->singleton( Illuminate\Contracts\Http\Kernel::class, App\Http\Kernel::class ); The application class binds the base […]

  • Method of Chinese search with laravel + elasticsearch

    Time:2021-8-7

    Elasticsearch Elasticsearch is an open source search engine based on Apache Lucene (TM). Lucene can be considered as the most advanced, best performing and most powerful search engine library in the open source or proprietary domain. However, Lucene is just a library. To play its powerful role, you need to use Java and integrate it […]

  • Summary of using skills of sharing 8 laravel model timestamps

    Time:2021-7-12

    By default, the default data table of laravel eloquent model is created_ At and updated_ There are two fields. Of course, we can do a lot of custom configuration to achieve a lot of interesting functions. Here is an example. 1. Disable timestamp If the data table does not have these two fields, model:: create […]