app/Filters/Book/BookFilters.php
/**
     * Mappings for database values.
     *
     * @return array
     */
Mappings for database values.
@return array
Mappings for database values . @return array
public static function mappings()
    {
        $map = [
            'access' => [
                'free' => 'Free',
                'premium' => 'Premium'
            ],
            'difficulty' => [
                'beginner' => 'Beginner',
                'intermediate' => 'Intermediate',
                'advanced' => 'Advanced'
            ],
            'type' => [
                'snippet' => 'Snippet',
                'project' => 'Project',
                'theory' => 'Theory'
            ],
            'subject' => Subject::get()->pluck('name', 'slug'),
        ];
        if (auth()->check()) {
            $map = array_merge($map, [
                'started' => [
                    'true' => 'Started',
                    'false' => 'Not started'
                ]
            ]);
        }
        return $map;
    }
public static function mappings ( ) { $ map = [ 'access' => [ 'free' => 'Free' , 'premium' => 'Premium' ] , 'difficulty' => [ 'beginner' => 'Beginner' , 'intermediate' => 'Intermediate' , 'advanced' => 'Advanced' ] , 'type' => [ 'snippet' => 'Snippet' , 'project' => 'Project' , 'theory' => 'Theory' ] , 'subject' => Subject :: get ( ) -> pluck ( 'name' , 'slug' ) , ] ; if ( auth ( ) -> check ( ) ) { $ map = array_merge ( $ map , [ 'started' => [ 'true' => 'Started' , 'false' => 'Not started' ] ] ) ; } return $ map ; }
Mappings for database values.
Mappings for database values .