Download the PHP package digbang/laravel-project without Composer
On this page you can find all versions of the php package digbang/laravel-project. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-project
project-name
Installation
- Clone repository
- Start the containers
- Access the PHP container and:
A. RUN
composer config -g github-oauth.github.com <token>
(To create the token go to: https://github.com/settings/tokens/new and set the repo permissions)
B. RUN
composer install
C. RUN
ln -s /proxies proxies
D. RUN
composer build
Minio configuration
- ADD "127.0.0.1 s3" to your hosts file
- ACCESS
http://localhost:9000/minio
, - Login with the access and secret keys located in
docker-compose.yml
. - Create a bucket with some name. Add a R/W policy to the bucket.
- Configure the bucket name in your env file
- Change the filesystem driver to
minio
Sentry configuration
- Configure your .env variables
- Enable Sentry on your .env file
System Configuration
- Remember that all sites must use HTTPS. And please choose a proper redirect:
- http://www.site.com should redirect to https://www.site.com
- http://site.com should redirect to https://www.site.com
- https://site.com should redirect to https://www.site.com
- The sub-domain (www), can be interchanged in the examples. But you must choose to use it and redirect TO it or not use it and redirect FROM it.
- Please see docker/apache/default.conf for the server configuration to access the site and resources.
Publish Assets
php artisan vendor:publish --provider "Digbang\\Backoffice\\BackofficeServiceProvider" --tag assets --force
Compiling Assets (Vite)
Vite is a modern frontend build tool that provides an extremely fast development environment and bundles your code for production.
In order to serve the assets for development you should use the npm run dev
command (that compile the assets and server then through localhost:3000), and for production builds you should use the npm run build
command.
If you use Vite, make sure that your layout uses the @vite directive and points to the resources correctly: @vite(['resources/css/app.css', 'resources/js/app.js'])
For more information about Vite, please follow the official documentation: https://laravel.com/docs/9.x/vite
Patrol - Track vulnerable or outdated dependencies
Patrol is an elegant command-line tool that keeps your PHP Project's dependencies in check.
composer patrol
Pint - Code Style fixer
Laravel Pint is an opinionated PHP code style fixer for minimalists. Pint is built on top of PHP-CS-Fixer and makes it simple to ensure that your code style stays clean and consistent.
composer cs
SPECIAL DIRECTORIES
Permissions
Proxies (ensure the symlink exists...)
Repositories on Request
If you need a repository you may do this:
Example:
If you need a repository method that doesnt exist in ReadRepository, you must create a private method into your request.
Example:
HTTP Codes references
The next list contains the HTTP codes returned by the API and the meaning in the present context:
- HTTP 200 Ok: the request has been processed successfully.
- HTTP 201 Created: the resource has been created. It's associated with a POST Request.
- HTTP 204 No Content: the request has been processed successfully but does not need to return an entity-body.
- HTTP 400 Bad Request: the request could not been processed by the API. You should review the data sent to.
- HTTP 401 Unauthorized: When the request was performed to the login endpoint, means that credentials are not matching with any. When the request was performed to another endpoint means that the token it's not valid anymore due TTL expiration.
- HTTP 403 Forbidden: the credentials provided with the request has not the necessary permission to be processed.
- HTTP 404 Not Found: the endpoint requested does not exist in the API.
- HTTP 422: the payload sent to the API did not pass the validation process.
- HTTP 500: an unknown error was triggered during the process.
Please refer to https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for reference
Php Stan
You should now have a phpstan.neon
file that allows you to configure the basics of this package.
https://github.com/nunomaduro/larastan https://phpstan.org/user-guide/getting-started
Php Insight
Config File
You should now have a config/insights.php
file that allows you to configure the basics of this package.
https://phpinsights.com/get-started.html
Laravel Responder
Creating Responses
Creating Transformers
php artisan make:transformer ProductTransformer --plain
Handling Exceptions
Convert Custom Exceptions
In addition to letting the package convert Laravel exceptions, you can also convert your own exceptions using the convert
method in the render
method:
You can optionally give it a closure that throws the new exception, if you want to give it constructor parameters:
Creating HTTP Exceptions
An exception class is a convenient place to store information about an error. The package provides an abstract exception class Flugg\Responder\Exceptions\Http\HttpException
, which has knowledge about status code, an error code and an error message. Continuing on our product example from above, we could create our own HttpException
class:
You can also add a data
method returning additional error data:
If you're letting the package handle exceptions, you can now throw the exception anywhere in your application and it will automatically be rendered to an error response.
https://github.com/flugger/laravel-responder
JWT Auth
Config File
You should now have a config/jwt.php
file that allows you to configure the basics of this package.
Generate secret key
I have included a helper command to generate a key for you:
php artisan jwt:secret
This will update your .env
file with something like JWT_SECRET=foobar
It is the key that will be used to sign your tokens. How that happens exactly will depend on the algorithm that you choose to use.
https://github.com/tymondesigns/jwt-auth
System Requirements
- php: 7.4.x
-
php ini configurations:
upload_max_filesize = 100M
post_max_size = 100M
- This numbers are illustrative. Set them according to your project needs.
- php extensions:
- bcmath
- Core
- ctype
- curl
- date
- dom
- fileinfo
- filter
- ftp
- gd
- hash
- iconv
- imagick
- intl
- json
- libxml
- mbstring
- mcrypt
- mysqlnd
- openssl
- pcntl
- pcre
- PDO
- pdo_pgsql
- pdo_sqlite
- Phar
- posix
- readline
- redis
- Reflection
- session
- SimpleXML
- soap
- SPL
- sqlite3
- standard
- tidy
- tokenizer
- xdebug
- xml
- xmlreader
- xmlwriter
- ZendOPcache
- zip
- zlib
- Composer PHP
- apache: 2.4.x / nginx
- postgres: 11.x / 12.x
- postgres extensions:
- Unaccent Extension
- redis
- node
- npm
- yarn
- SO Packages:
- locales
- locales-all
Overriding php configuration
Overriding php ini default configurations
In order to override .ini configurations, use the custom.ini
file in ./docker/php/conf.d
directory on the root of the project.
After changing the file, you will need to rebuild your container: docker-compose up -d --build php
.
It's recommended to change
upload_max_filesize
,post_max_size
. Have in mind this values should be changed in all environments.It's recommended to change
memory_limit
if you need it. In this case, only in dev environments.
Override extensions config
In order to override any extension setting you should be able to put the corresponding .ini file inside ./docker/php/conf.d folder, that is relative to the application root folder.
Remember, by convention any extension config file should be named as
docker-php-ext-{extension name}.ini
.
For example, if you wish to override opcache you should create the following file:
./docker/php/conf.d/docker-php-ext-opcache.ini
and fill it with everything you need. Same for xdebug: ./docker/php/conf.d/docker-php-ext-xdebug.ini
.
Then, copy those files from the host into the container, use the following command inside ./docker/php/Dockerfile
: COPY conf.d /usr/local/etc/php/conf.d/
It will be reflected on the next
docker-compose up --build
Notes
All versions of laravel-project with dependencies
ext-json Version *
cakephp/chronos Version ^2.3
digbang/backoffice Version ^9.0
digbang/doctrine-extensions Version ^3.0
digbang/safe-queue Version ^1.0
digbang/utils Version ^2.0
flugger/laravel-responder Version ^3.2
fruitcake/laravel-cors Version ^2.0
gedmo/doctrine-extensions Version ^3.2
laravel-doctrine/extensions Version ^1.4
laravel-doctrine/fluent Version ^1.2
laravel-doctrine/orm Version ^1.8
laravel/framework Version ^9.0
laravel/sanctum Version ^2.14
laravel/tinker Version ^2.7
php-open-source-saver/jwt-auth Version ^2.0
sentry/sentry-laravel Version ^2.11