PHPackages                             976-tuna/news - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. 976-tuna/news

ActiveLibrary

976-tuna/news
=============

NEWS

v1.2.16(1y ago)031MITBladePHP ^8.2

Since Apr 21Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/TerrenceBerg/news)[ Packagist](https://packagist.org/packages/976-tuna/news)[ RSS](/packages/976-tuna-news/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (24)Used By (0)

News Blog App for Laravel
=========================

[](#news-blog-app-for-laravel)

Installation
------------

[](#installation)

install Laravel

Install Bootstrap
-----------------

[](#install-bootstrap)

```
composer require laravel/ui --dev
php artisan ui bootstrap --auth
```

Install the bootstrap icons library.
------------------------------------

[](#install-the-bootstrap-icons-library)

```
npm install bootstrap-icons --save-dev
```

Install the Livewire and assets.
--------------------------------

[](#install-the-livewire-and-assets)

```
composer require livewire/livewire
php artisan livewire:publish --assets
```

Install Package
---------------

[](#install-package)

```
composer require 976-tuna/news
php artisan vendor:publish --provider="Tuna976\NEWS\NEWSServiceProvider" --tag="news-files"
php artisan migrate
```

Integration
-----------

[](#integration)

### Add the following to your user model:

[](#add-the-following-to-your-user-model)

```
// Role-based authentication methods
    public function isAdmin(): bool
    {
        return $this->role === 'admin';
    }

    public function isAuthor(): bool
    {
        return $this->role === 'author' || $this->isAdmin();
    }

    public function posts(): HasMany
    {
        return $this->hasMany(Post::class);
    }

    public function comments(): HasMany
    {
        return $this->hasMany(Comment::class);
    }
```

Inside your project, open the file resources\\sass\\app.scss and add :
----------------------------------------------------------------------

[](#inside-your-project-open-the-file-resourcessassappscss-and-add-)

```
@import 'bootstrap-icons/font/bootstrap-icons.css';
```

Inside your project, open the file app/Http/Controllers/Controller.php and make sure you have the following so Auth works properly
----------------------------------------------------------------------------------------------------------------------------------

[](#inside-your-project-open-the-file-apphttpcontrollerscontrollerphp-and-make-sure-you-have-the-following-so-auth-works-properly)

```
