GithubHelp home page GithubHelp logo

adenlall / laravel-blog-cms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guillaumebriday/laravel-blog

0.0 0.0 0.0 3.53 MB

CMS Laravel 10.0 blog application with Hotwire, Horizon, Telescope, Sanctum, Breeze and Pusher

License: MIT License

JavaScript 0.36% PHP 81.33% Blade 18.31%

laravel-blog-cms's Introduction

Laravel 10.x blog

The purpose of this repository is to show good development practices on Laravel as well as to present cases of use of the framework's features like:

Beside Laravel, this project uses other tools like:

Some screenshots

You can find some screenshots of the application on : https://imgur.com/a/Jbnwj

Installation

To create your development environment follow these instructions.

Setting up your development environment on your local machine:

$ git clone https://github.com/guillaumebriday/laravel-blog.git
$ cd laravel-blog
$ cp .env.example .env
$ php artisan key:generate
$ php artisan horizon:install
$ php artisan telescope:install
$ php artisan storage:link

Mailer

You can use Mailpit to test your emails in development.

Once installed, open http://localhost:8025.

Before starting

You need to run the migrations with the seeds :

$ php artisan migrate --seed

This will create a new user that you can use to sign in :

email: [email protected]
password: 4nak1n

And then, compile the assets :

$ yarn dev # or yarn watch

Starting job for newsletter :

$ php artisan tinker
> PrepareNewsletterSubscriptionEmail::dispatch();

Useful commands

Start Laravel Horizon:

$ php artisan horizon

Seeding the database :

$ php artisan db:seed

Running tests :

$ php artisan test

Running Laravel Pint :

$ ./vendor/bin/pint --verbose --test

Generating backup :

$ php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider"
$ php artisan backup:run

Generating fake data :

$ php artisan db:seed --class=DevDatabaseSeeder

Discover package

$ php artisan package:discover

In development environment, rebuild the database :

$ php artisan migrate:fresh --seed

Accessing the API

Clients can access to the REST API. API requests require authentication via Bearer token.

Generate a new token:

curl --location --request POST 'laravel-blog.test/api/v1/authenticate?email=your_email&password=your_password' \
     --header 'X-Requested-With: XMLHttpRequest'

And now you can use the meta.access_token key as your Bearer token:

curl --location 'laravel-blog.test/api/v1/posts' \
      --header 'X-Requested-With: XMLHttpRequest' \
      --header 'Authorization: Bearer access_token'

API are prefixed by api and the API version number like so v1.

Do not forget to set the X-Requested-With header to XMLHttpRequest. Otherwise, Laravel won't recognize the call as an AJAX request.

To list all the available routes for API :

$ php artisan route:list --path=api

Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

License

This project is released under the MIT license.

laravel-blog-cms's People

Contributors

guillaumebriday avatar renovate-bot avatar khoinv avatar matiaslauriti avatar makstech avatar tompenzer avatar ivothgle avatar ph-7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.