You are on page 1of 2

1.

*Installation:*

- composer create-project --prefer-dist laravel/laravel projectName: Creates a new Laravel project.

2. *Artisan Commands:*

- php artisan serve: Start the development server.

- php artisan migrate: Run database migrations.

- php artisan make:model ModelName -m: Create a model with a migration.

- php artisan make:controller ControllerName: Generate a new controller.

- php artisan make:middleware MiddlewareName: Create a new middleware.

- php artisan make:seeder SeederName: Generate a new database seeder.

- php artisan make:auth: Scaffold basic login and registration views and controllers.

3. *Database Migration:*

- Define database schema in migration files (database/migrations).

- Run migrations: php artisan migrate.

4. *Routing:*

- Define routes in routes/web.php (web routes) or routes/api.php (API routes).

- Example:

php

Route::get('/example', 'ExampleController@index');

5. *Controllers:*

- Controllers handle requests and define the application logic.

- Example:

php

class ExampleController extends Controller {

public function index() {

return view('example');
}

6. *Middleware:*

- Middleware provides a convenient mechanism for filtering HTTP requests.

- Register middleware in App\Http\Kernel.php.

- Example:

php

public $middleware = [

// ...

\App\Http\Middleware\CustomMiddleware::class,

];

These are fundamental commands and concepts, and there's a lot more to explore as you dive
deeper into Laravel development. The official Laravel documentation is an excellent resource for
detailed information: [Laravel Documentation](https://laravel.com/docs).

You might also like