Full Code of laravel/lumen for AI

10.x b18a7652aa2d cached
37 files
19.8 KB
5.3k tokens
39 symbols
1 requests
Download .txt
Repository: laravel/lumen
Branch: 10.x
Commit: b18a7652aa2d
Files: 37
Total size: 19.8 KB

Directory structure:
gitextract_h7oooe27/

├── .editorconfig
├── .gitignore
├── .styleci.yml
├── README.md
├── app/
│   ├── Console/
│   │   ├── Commands/
│   │   │   └── .gitkeep
│   │   └── Kernel.php
│   ├── Events/
│   │   ├── Event.php
│   │   └── ExampleEvent.php
│   ├── Exceptions/
│   │   └── Handler.php
│   ├── Http/
│   │   ├── Controllers/
│   │   │   ├── Controller.php
│   │   │   └── ExampleController.php
│   │   └── Middleware/
│   │       ├── Authenticate.php
│   │       └── ExampleMiddleware.php
│   ├── Jobs/
│   │   ├── ExampleJob.php
│   │   └── Job.php
│   ├── Listeners/
│   │   └── ExampleListener.php
│   ├── Models/
│   │   └── User.php
│   └── Providers/
│       ├── AppServiceProvider.php
│       ├── AuthServiceProvider.php
│       └── EventServiceProvider.php
├── artisan
├── bootstrap/
│   └── app.php
├── composer.json
├── database/
│   ├── factories/
│   │   └── UserFactory.php
│   ├── migrations/
│   │   └── .gitkeep
│   └── seeders/
│       └── DatabaseSeeder.php
├── phpunit.xml
├── public/
│   ├── .htaccess
│   └── index.php
├── resources/
│   └── views/
│       └── .gitkeep
├── routes/
│   └── web.php
├── storage/
│   ├── app/
│   │   └── .gitignore
│   ├── framework/
│   │   ├── cache/
│   │   │   └── .gitignore
│   │   └── views/
│   │       └── .gitignore
│   └── logs/
│       └── .gitignore
└── tests/
    ├── ExampleTest.php
    └── TestCase.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2


================================================
FILE: .gitignore
================================================
/vendor
/.idea
Homestead.json
Homestead.yaml
.env
.phpunit.result.cache


================================================
FILE: .styleci.yml
================================================
php:
  preset: laravel
  disabled:
    - unused_use
js: true
css: true


================================================
FILE: README.md
================================================
# Lumen PHP Framework

[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
[![Total Downloads](https://img.shields.io/packagist/dt/laravel/lumen-framework)](https://packagist.org/packages/laravel/lumen-framework)
[![Latest Stable Version](https://img.shields.io/packagist/v/laravel/lumen-framework)](https://packagist.org/packages/laravel/lumen-framework)
[![License](https://img.shields.io/packagist/l/laravel/lumen)](https://packagist.org/packages/laravel/lumen-framework)

Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.

> **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com).

## Official Documentation

Documentation for the framework can be found on the [Lumen website](https://lumen.laravel.com/docs).

## Contributing

Thank you for considering contributing to Lumen! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).

## Security Vulnerabilities

If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.

## License

The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).


================================================
FILE: app/Console/Commands/.gitkeep
================================================


================================================
FILE: app/Console/Kernel.php
================================================
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //
    }
}


================================================
FILE: app/Events/Event.php
================================================
<?php

namespace App\Events;

use Illuminate\Queue\SerializesModels;

abstract class Event
{
    use SerializesModels;
}


================================================
FILE: app/Events/ExampleEvent.php
================================================
<?php

namespace App\Events;

class ExampleEvent extends Event
{
    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }
}


================================================
FILE: app/Exceptions/Handler.php
================================================
<?php

namespace App\Exceptions;

use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Validation\ValidationException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable;

class Handler extends ExceptionHandler
{
    /**
     * A list of the exception types that should not be reported.
     *
     * @var array
     */
    protected $dontReport = [
        AuthorizationException::class,
        HttpException::class,
        ModelNotFoundException::class,
        ValidationException::class,
    ];

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param  \Throwable  $exception
     * @return void
     *
     * @throws \Exception
     */
    public function report(Throwable $exception)
    {
        parent::report($exception);
    }

    /**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Throwable  $exception
     * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
     *
     * @throws \Throwable
     */
    public function render($request, Throwable $exception)
    {
        return parent::render($request, $exception);
    }
}


================================================
FILE: app/Http/Controllers/Controller.php
================================================
<?php

namespace App\Http\Controllers;

use Laravel\Lumen\Routing\Controller as BaseController;

class Controller extends BaseController
{
    //
}


================================================
FILE: app/Http/Controllers/ExampleController.php
================================================
<?php

namespace App\Http\Controllers;

class ExampleController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    //
}


================================================
FILE: app/Http/Middleware/Authenticate.php
================================================
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Factory as Auth;

class Authenticate
{
    /**
     * The authentication guard factory instance.
     *
     * @var \Illuminate\Contracts\Auth\Factory
     */
    protected $auth;

    /**
     * Create a new middleware instance.
     *
     * @param  \Illuminate\Contracts\Auth\Factory  $auth
     * @return void
     */
    public function __construct(Auth $auth)
    {
        $this->auth = $auth;
    }

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @param  string|null  $guard
     * @return mixed
     */
    public function handle($request, Closure $next, $guard = null)
    {
        if ($this->auth->guard($guard)->guest()) {
            return response('Unauthorized.', 401);
        }

        return $next($request);
    }
}


================================================
FILE: app/Http/Middleware/ExampleMiddleware.php
================================================
<?php

namespace App\Http\Middleware;

use Closure;

class ExampleMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        return $next($request);
    }
}


================================================
FILE: app/Jobs/ExampleJob.php
================================================
<?php

namespace App\Jobs;

class ExampleJob extends Job
{
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        //
    }
}


================================================
FILE: app/Jobs/Job.php
================================================
<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

abstract class Job implements ShouldQueue
{
    /*
    |--------------------------------------------------------------------------
    | Queueable Jobs
    |--------------------------------------------------------------------------
    |
    | This job base class provides a central location to place any logic that
    | is shared across all of your jobs. The trait included with the class
    | provides access to the "queueOn" and "delay" queue helper methods.
    |
    */

    use InteractsWithQueue, Queueable, SerializesModels;
}


================================================
FILE: app/Listeners/ExampleListener.php
================================================
<?php

namespace App\Listeners;

use App\Events\ExampleEvent;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class ExampleListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  \App\Events\ExampleEvent  $event
     * @return void
     */
    public function handle(ExampleEvent $event)
    {
        //
    }
}


================================================
FILE: app/Models/User.php
================================================
<?php

namespace App\Models;

use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laravel\Lumen\Auth\Authorizable;

class User extends Model implements AuthenticatableContract, AuthorizableContract
{
    use Authenticatable, Authorizable, HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var string[]
     */
    protected $fillable = [
        'name', 'email',
    ];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var string[]
     */
    protected $hidden = [
        'password',
    ];
}


================================================
FILE: app/Providers/AppServiceProvider.php
================================================
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}


================================================
FILE: app/Providers/AuthServiceProvider.php
================================================
<?php

namespace App\Providers;

use App\Models\User;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Boot the authentication services for the application.
     *
     * @return void
     */
    public function boot()
    {
        // Here you may define how you wish users to be authenticated for your Lumen
        // application. The callback which receives the incoming request instance
        // should return either a User instance or null. You're free to obtain
        // the User instance via an API token or any other method necessary.

        $this->app['auth']->viaRequest('api', function ($request) {
            if ($request->input('api_token')) {
                return User::where('api_token', $request->input('api_token'))->first();
            }
        });
    }
}


================================================
FILE: app/Providers/EventServiceProvider.php
================================================
<?php

namespace App\Providers;

use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        \App\Events\ExampleEvent::class => [
            \App\Listeners\ExampleListener::class,
        ],
    ];

    /**
     * Determine if events and listeners should be automatically discovered.
     *
     * @return bool
     */
    public function shouldDiscoverEvents()
    {
        return false;
    }
}


================================================
FILE: artisan
================================================
#!/usr/bin/env php
<?php

use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| First we need to get an application instance. This creates an instance
| of the application / container and bootstraps the application so it
| is ready to receive HTTP / Console requests from the environment.
|
*/

$app = require __DIR__.'/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/

$kernel = $app->make(
    'Illuminate\Contracts\Console\Kernel'
);

exit($kernel->handle(new ArgvInput, new ConsoleOutput));


================================================
FILE: bootstrap/app.php
================================================
<?php

require_once __DIR__.'/../vendor/autoload.php';

(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
    dirname(__DIR__)
))->bootstrap();

date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| Here we will load the environment and create the application instance
| that serves as the central piece of this framework. We'll use this
| application as an "IoC" container and router for this framework.
|
*/

$app = new Laravel\Lumen\Application(
    dirname(__DIR__)
);

// $app->withFacades();

// $app->withEloquent();

/*
|--------------------------------------------------------------------------
| Register Container Bindings
|--------------------------------------------------------------------------
|
| Now we will register a few bindings in the service container. We will
| register the exception handler and the console kernel. You may add
| your own bindings here if you like or you can make another file.
|
*/

$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    App\Exceptions\Handler::class
);

$app->singleton(
    Illuminate\Contracts\Console\Kernel::class,
    App\Console\Kernel::class
);

/*
|--------------------------------------------------------------------------
| Register Config Files
|--------------------------------------------------------------------------
|
| Now we will register the "app" configuration file. If the file exists in
| your configuration directory it will be loaded; otherwise, we'll load
| the default version. You may register other files below as needed.
|
*/

$app->configure('app');

/*
|--------------------------------------------------------------------------
| Register Middleware
|--------------------------------------------------------------------------
|
| Next, we will register the middleware with the application. These can
| be global middleware that run before and after each request into a
| route or middleware that'll be assigned to some specific routes.
|
*/

// $app->middleware([
//     App\Http\Middleware\ExampleMiddleware::class
// ]);

// $app->routeMiddleware([
//     'auth' => App\Http\Middleware\Authenticate::class,
// ]);

/*
|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
|
| Here we will register all of the application's service providers which
| are used to bind services into the container. Service providers are
| totally optional, so you are not required to uncomment this line.
|
*/

// $app->register(App\Providers\AppServiceProvider::class);
// $app->register(App\Providers\AuthServiceProvider::class);
// $app->register(App\Providers\EventServiceProvider::class);

/*
|--------------------------------------------------------------------------
| Load The Application Routes
|--------------------------------------------------------------------------
|
| Next we will include the routes file so that they can all be added to
| the application. This will provide all of the URLs the application
| can respond to, as well as the controllers that may handle them.
|
*/

$app->router->group([
    'namespace' => 'App\Http\Controllers',
], function ($router) {
    require __DIR__.'/../routes/web.php';
});

return $app;


================================================
FILE: composer.json
================================================
{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^8.1",
        "laravel/lumen-framework": "^10.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "mockery/mockery": "^1.4.4",
        "phpunit/phpunit": "^10.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ]
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}


================================================
FILE: database/factories/UserFactory.php
================================================
<?php

namespace Database\Factories;

use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

class UserFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = User::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'name' => $this->faker->name,
            'email' => $this->faker->unique()->safeEmail,
        ];
    }
}


================================================
FILE: database/migrations/.gitkeep
================================================


================================================
FILE: database/seeders/DatabaseSeeder.php
================================================
<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->call('UsersTableSeeder');
    }
}


================================================
FILE: phpunit.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
         bootstrap="vendor/autoload.php"
         colors="true"
>
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory suffix="Test.php">./tests</directory>
        </testsuite>
    </testsuites>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
    </php>
</phpunit>


================================================
FILE: public/.htaccess
================================================
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>


================================================
FILE: public/index.php
================================================
<?php

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| First we need to get an application instance. This creates an instance
| of the application / container and bootstraps the application so it
| is ready to receive HTTP / Console requests from the environment.
|
*/

$app = require __DIR__.'/../bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$app->run();


================================================
FILE: resources/views/.gitkeep
================================================


================================================
FILE: routes/web.php
================================================
<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});


================================================
FILE: storage/app/.gitignore
================================================
*
!.gitignore


================================================
FILE: storage/framework/cache/.gitignore
================================================
*
!data/
!.gitignore


================================================
FILE: storage/framework/views/.gitignore
================================================
*
!.gitignore


================================================
FILE: storage/logs/.gitignore
================================================
*
!.gitignore


================================================
FILE: tests/ExampleTest.php
================================================
<?php

namespace Tests;

use Laravel\Lumen\Testing\DatabaseMigrations;
use Laravel\Lumen\Testing\DatabaseTransactions;

class ExampleTest extends TestCase
{
    /**
     * A basic test example.
     *
     * @return void
     */
    public function test_that_base_endpoint_returns_a_successful_response()
    {
        $this->get('/');

        $this->assertEquals(
            $this->app->version(), $this->response->getContent()
        );
    }
}


================================================
FILE: tests/TestCase.php
================================================
<?php

namespace Tests;

use Laravel\Lumen\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    /**
     * Creates the application.
     *
     * @return \Laravel\Lumen\Application
     */
    public function createApplication()
    {
        return require __DIR__.'/../bootstrap/app.php';
    }
}
Download .txt
gitextract_h7oooe27/

├── .editorconfig
├── .gitignore
├── .styleci.yml
├── README.md
├── app/
│   ├── Console/
│   │   ├── Commands/
│   │   │   └── .gitkeep
│   │   └── Kernel.php
│   ├── Events/
│   │   ├── Event.php
│   │   └── ExampleEvent.php
│   ├── Exceptions/
│   │   └── Handler.php
│   ├── Http/
│   │   ├── Controllers/
│   │   │   ├── Controller.php
│   │   │   └── ExampleController.php
│   │   └── Middleware/
│   │       ├── Authenticate.php
│   │       └── ExampleMiddleware.php
│   ├── Jobs/
│   │   ├── ExampleJob.php
│   │   └── Job.php
│   ├── Listeners/
│   │   └── ExampleListener.php
│   ├── Models/
│   │   └── User.php
│   └── Providers/
│       ├── AppServiceProvider.php
│       ├── AuthServiceProvider.php
│       └── EventServiceProvider.php
├── artisan
├── bootstrap/
│   └── app.php
├── composer.json
├── database/
│   ├── factories/
│   │   └── UserFactory.php
│   ├── migrations/
│   │   └── .gitkeep
│   └── seeders/
│       └── DatabaseSeeder.php
├── phpunit.xml
├── public/
│   ├── .htaccess
│   └── index.php
├── resources/
│   └── views/
│       └── .gitkeep
├── routes/
│   └── web.php
├── storage/
│   ├── app/
│   │   └── .gitignore
│   ├── framework/
│   │   ├── cache/
│   │   │   └── .gitignore
│   │   └── views/
│   │       └── .gitignore
│   └── logs/
│       └── .gitignore
└── tests/
    ├── ExampleTest.php
    └── TestCase.php
Download .txt
SYMBOL INDEX (39 symbols across 19 files)

FILE: app/Console/Kernel.php
  class Kernel (line 8) | class Kernel extends ConsoleKernel
    method schedule (line 25) | protected function schedule(Schedule $schedule)

FILE: app/Events/Event.php
  class Event (line 7) | abstract class Event

FILE: app/Events/ExampleEvent.php
  class ExampleEvent (line 5) | class ExampleEvent extends Event
    method __construct (line 12) | public function __construct()

FILE: app/Exceptions/Handler.php
  class Handler (line 12) | class Handler extends ExceptionHandler
    method report (line 36) | public function report(Throwable $exception)
    method render (line 50) | public function render($request, Throwable $exception)

FILE: app/Http/Controllers/Controller.php
  class Controller (line 7) | class Controller extends BaseController

FILE: app/Http/Controllers/ExampleController.php
  class ExampleController (line 5) | class ExampleController extends Controller
    method __construct (line 12) | public function __construct()

FILE: app/Http/Middleware/Authenticate.php
  class Authenticate (line 8) | class Authenticate
    method __construct (line 23) | public function __construct(Auth $auth)
    method handle (line 36) | public function handle($request, Closure $next, $guard = null)

FILE: app/Http/Middleware/ExampleMiddleware.php
  class ExampleMiddleware (line 7) | class ExampleMiddleware
    method handle (line 16) | public function handle($request, Closure $next)

FILE: app/Jobs/ExampleJob.php
  class ExampleJob (line 5) | class ExampleJob extends Job
    method __construct (line 12) | public function __construct()
    method handle (line 22) | public function handle()

FILE: app/Jobs/Job.php
  class Job (line 10) | abstract class Job implements ShouldQueue

FILE: app/Listeners/ExampleListener.php
  class ExampleListener (line 9) | class ExampleListener
    method __construct (line 16) | public function __construct()
    method handle (line 27) | public function handle(ExampleEvent $event)

FILE: app/Models/User.php
  class User (line 12) | class User extends Model implements AuthenticatableContract, Authorizabl...

FILE: app/Providers/AppServiceProvider.php
  class AppServiceProvider (line 7) | class AppServiceProvider extends ServiceProvider
    method register (line 14) | public function register()

FILE: app/Providers/AuthServiceProvider.php
  class AuthServiceProvider (line 9) | class AuthServiceProvider extends ServiceProvider
    method register (line 16) | public function register()
    method boot (line 26) | public function boot()

FILE: app/Providers/EventServiceProvider.php
  class EventServiceProvider (line 7) | class EventServiceProvider extends ServiceProvider
    method shouldDiscoverEvents (line 25) | public function shouldDiscoverEvents()

FILE: database/factories/UserFactory.php
  class UserFactory (line 8) | class UserFactory extends Factory
    method definition (line 22) | public function definition()

FILE: database/seeders/DatabaseSeeder.php
  class DatabaseSeeder (line 8) | class DatabaseSeeder extends Seeder
    method run (line 15) | public function run()

FILE: tests/ExampleTest.php
  class ExampleTest (line 8) | class ExampleTest extends TestCase
    method test_that_base_endpoint_returns_a_successful_response (line 15) | public function test_that_base_endpoint_returns_a_successful_response()

FILE: tests/TestCase.php
  class TestCase (line 7) | abstract class TestCase extends BaseTestCase
    method createApplication (line 14) | public function createApplication()
Condensed preview — 37 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (23K chars).
[
  {
    "path": ".editorconfig",
    "chars": 220,
    "preview": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\nindent_style = space\nindent_size = 4\ntrim_"
  },
  {
    "path": ".gitignore",
    "chars": 72,
    "preview": "/vendor\n/.idea\nHomestead.json\nHomestead.yaml\n.env\n.phpunit.result.cache\n"
  },
  {
    "path": ".styleci.yml",
    "chars": 71,
    "preview": "php:\n  preset: laravel\n  disabled:\n    - unused_use\njs: true\ncss: true\n"
  },
  {
    "path": "README.md",
    "chars": 1920,
    "preview": "# Lumen PHP Framework\n\n[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/larave"
  },
  {
    "path": "app/Console/Commands/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "app/Console/Kernel.php",
    "chars": 546,
    "preview": "<?php\n\nnamespace App\\Console;\n\nuse Illuminate\\Console\\Scheduling\\Schedule;\nuse Laravel\\Lumen\\Console\\Kernel as ConsoleKe"
  },
  {
    "path": "app/Events/Event.php",
    "chars": 121,
    "preview": "<?php\n\nnamespace App\\Events;\n\nuse Illuminate\\Queue\\SerializesModels;\n\nabstract class Event\n{\n    use SerializesModels;\n}"
  },
  {
    "path": "app/Events/ExampleEvent.php",
    "chars": 203,
    "preview": "<?php\n\nnamespace App\\Events;\n\nclass ExampleEvent extends Event\n{\n    /**\n     * Create a new event instance.\n     *\n    "
  },
  {
    "path": "app/Exceptions/Handler.php",
    "chars": 1368,
    "preview": "<?php\n\nnamespace App\\Exceptions;\n\nuse Illuminate\\Auth\\Access\\AuthorizationException;\nuse Illuminate\\Database\\Eloquent\\Mo"
  },
  {
    "path": "app/Http/Controllers/Controller.php",
    "chars": 148,
    "preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Laravel\\Lumen\\Routing\\Controller as BaseController;\n\nclass Controller extend"
  },
  {
    "path": "app/Http/Controllers/ExampleController.php",
    "chars": 236,
    "preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nclass ExampleController extends Controller\n{\n    /**\n     * Create a new control"
  },
  {
    "path": "app/Http/Middleware/Authenticate.php",
    "chars": 911,
    "preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Contracts\\Auth\\Factory as Auth;\n\nclass Authenticate\n{"
  },
  {
    "path": "app/Http/Middleware/ExampleMiddleware.php",
    "chars": 337,
    "preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Closure;\n\nclass ExampleMiddleware\n{\n    /**\n     * Handle an incoming request"
  },
  {
    "path": "app/Jobs/ExampleJob.php",
    "chars": 315,
    "preview": "<?php\n\nnamespace App\\Jobs;\n\nclass ExampleJob extends Job\n{\n    /**\n     * Create a new job instance.\n     *\n     * @retu"
  },
  {
    "path": "app/Jobs/Job.php",
    "chars": 720,
    "preview": "<?php\n\nnamespace App\\Jobs;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Que"
  },
  {
    "path": "app/Listeners/ExampleListener.php",
    "chars": 496,
    "preview": "<?php\n\nnamespace App\\Listeners;\n\nuse App\\Events\\ExampleEvent;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate"
  },
  {
    "path": "app/Models/User.php",
    "chars": 796,
    "preview": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Auth\\Authenticatable;\nuse Illuminate\\Contracts\\Auth\\Access\\Authorizable as "
  },
  {
    "path": "app/Providers/AppServiceProvider.php",
    "chars": 266,
    "preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\ServiceProvider;\n\nclass AppServiceProvider extends ServiceProvid"
  },
  {
    "path": "app/Providers/AuthServiceProvider.php",
    "chars": 1023,
    "preview": "<?php\n\nnamespace App\\Providers;\n\nuse App\\Models\\User;\nuse Illuminate\\Support\\Facades\\Gate;\nuse Illuminate\\Support\\Servic"
  },
  {
    "path": "app/Providers/EventServiceProvider.php",
    "chars": 593,
    "preview": "<?php\n\nnamespace App\\Providers;\n\nuse Laravel\\Lumen\\Providers\\EventServiceProvider as ServiceProvider;\n\nclass EventServic"
  },
  {
    "path": "artisan",
    "chars": 1094,
    "preview": "#!/usr/bin/env php\n<?php\n\nuse Symfony\\Component\\Console\\Input\\ArgvInput;\nuse Symfony\\Component\\Console\\Output\\ConsoleOut"
  },
  {
    "path": "bootstrap/app.php",
    "chars": 3460,
    "preview": "<?php\n\nrequire_once __DIR__.'/../vendor/autoload.php';\n\n(new Laravel\\Lumen\\Bootstrap\\LoadEnvironmentVariables(\n    dirna"
  },
  {
    "path": "composer.json",
    "chars": 1034,
    "preview": "{\n    \"name\": \"laravel/lumen\",\n    \"description\": \"The Laravel Lumen Framework.\",\n    \"keywords\": [\"framework\", \"laravel"
  },
  {
    "path": "database/factories/UserFactory.php",
    "chars": 541,
    "preview": "<?php\n\nnamespace Database\\Factories;\n\nuse App\\Models\\User;\nuse Illuminate\\Database\\Eloquent\\Factories\\Factory;\n\nclass Us"
  },
  {
    "path": "database/migrations/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "database/seeders/DatabaseSeeder.php",
    "chars": 323,
    "preview": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Console\\Seeds\\WithoutModelEvents;\nuse Illuminate\\Database\\Se"
  },
  {
    "path": "phpunit.xml",
    "chars": 592,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:noNam"
  },
  {
    "path": "public/.htaccess",
    "chars": 593,
    "preview": "<IfModule mod_rewrite.c>\n    <IfModule mod_negotiation.c>\n        Options -MultiViews -Indexes\n    </IfModule>\n\n    Rewr"
  },
  {
    "path": "public/index.php",
    "chars": 897,
    "preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Create The Application\n|--------"
  },
  {
    "path": "resources/views/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "routes/web.php",
    "chars": 527,
    "preview": "<?php\n\n/** @var \\Laravel\\Lumen\\Routing\\Router $router */\n\n/*\n|----------------------------------------------------------"
  },
  {
    "path": "storage/app/.gitignore",
    "chars": 14,
    "preview": "*\n!.gitignore\n"
  },
  {
    "path": "storage/framework/cache/.gitignore",
    "chars": 21,
    "preview": "*\n!data/\n!.gitignore\n"
  },
  {
    "path": "storage/framework/views/.gitignore",
    "chars": 14,
    "preview": "*\n!.gitignore\n"
  },
  {
    "path": "storage/logs/.gitignore",
    "chars": 14,
    "preview": "*\n!.gitignore\n"
  },
  {
    "path": "tests/ExampleTest.php",
    "chars": 450,
    "preview": "<?php\n\nnamespace Tests;\n\nuse Laravel\\Lumen\\Testing\\DatabaseMigrations;\nuse Laravel\\Lumen\\Testing\\DatabaseTransactions;\n\n"
  },
  {
    "path": "tests/TestCase.php",
    "chars": 332,
    "preview": "<?php\n\nnamespace Tests;\n\nuse Laravel\\Lumen\\Testing\\TestCase as BaseTestCase;\n\nabstract class TestCase extends BaseTestCa"
  }
]

About this extraction

This page contains the full source code of the laravel/lumen GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 37 files (19.8 KB), approximately 5.3k tokens, and a symbol index with 39 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!