PHP code example of maikealame / laravel-auto

1. Go to this page and download the library: Download maikealame/laravel-auto library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maikealame / laravel-auto example snippets


if (Request::has("filter")) {
    if (isset(Request::get("filter")['keyword'])) {
        $keyword = Request::get("filter")['keyword'];
        Auto::setField("notifications.title", $keyword);
        Auto::setField("notifications.description", $keyword);
    }
}
$notifications = Notification::select("notifications.*", "notification_users.readed_at")
            ->groupBy("notifications.id")
            ->leftJoin("notifications_users", "notifications.id", "=", "notifications_users.notification_id")
            ->leftJoin("notifications_roles", "notifications.id", "=", "notifications_roles.notification_id")
            ->leftJoin("notifications_departments", "notifications.id", "=", "notifications_departments.notification_id")
            ->autoWhere(['or' => ["notifications.title", "notifications.description"]])
            ->autoSort(["notifications.updated_at", "desc"])->autoPaginate();