A Laravel library that allows your application to interact like a social network, in one of a heck of a simple way.
- PHP: 8 or higher
- ext-json: *
- Laravel Framework: ^6|^7|^8
- Milebits Eloquent Filters: 2 or higher
- Milebits Laravel Stream: 1 or higher
- Milebits Helpers: 1 or higher
It is quite simple to install this package and all its features, all you have to do is:
composer require milebits/society
After the composer installation is complete, you need to add the Sociable
trait to the model you want to be social, in
our case it will be the App\Models\User
class that will be our sociable model.
use Illuminate\Database\Eloquent\Model;
use Milebits\Society\Concerns\Sociable;
class User extends Model
{
use Sociable;
}
And there you are, you have just installed the Sociable package to your model!
public function getSocietyRepository(Illuminate\Http\Request $request)
{
return $request->user()->society;
}
public function store(Illuminate\Http\Request $request, \Illuminate\Database\Eloquent\Model $friend)
{
return $request->user()->society()->friends()->add($friend);
}
The rest of the documentation is coming later...
If in any case while using this package, and you which to request a new functionality to it, please contact us at [email protected] and mention the package you are willing to contribute or suggest a new functionality.
If in any case while using this package, you encounter security issues or security vulnerabilities, please do report them as soon as possible by issuing an issue here in GitHub or by sending an email to [email protected] with the mention Vulnerability Report milebits/society as your subject.