Code Monkey home page Code Monkey logo

laravel-auto's Introduction

Hi there ๐Ÿ‘‹

Visits Badge Repos Badge Created Badge

About me ๐Ÿ‘จโ€๐Ÿ’ป

Skills ๐Ÿ”ฅ

Languages

JavaScript TypeScript PHP Python Ruby

Front-end

HTML5 CSS3 Sass Tailwind.css Bootstrap MUI Styled-Comp Material UI React React Native Redux Next.JS Vue Vuetify Nuxt.JS jQuery Quasar

Back-end

NodeJS Express.js Koa NestJS Laravel DjangoREST Django FastAPI Rails AdonisJS

Databases

Mysql Postgres MongoDB Sqlite Redis Firebase

Testing

Jest Testing-Library Mocha Chai PHPUnit Pest PHP

Other

Webpack Socket.io GraphQL Celery RabbitMQ Beanstalkd Apache Kafka

Telemetry

Datadog

DevOps

Docker Kubernetes Rancher Jenkins

Cloud

Sass Sass Sass

GIT Server

Sass Sass Sass

Github public stats ๐Ÿ“Š

MaikeAlame's github stats

laravel-auto's People

Contributors

maikealame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-auto's Issues

Auto setDefaultField() doesn't override

Hi,

So thsi is my query:

Auto::setDefaultField('tournaments.season_id', getCurrentSeason()->id);

		$list = Tournament::select('tournaments.*')
						  ->leftJoin(
							  "divisions", "divisions.id", "=",
							  "tournaments.division_id"
						  )
						  ->leftJoin(
							  "seasons", "seasons.id", "=",
							  "tournaments.season_id"
						  )
						  ->autoWhere(["columns" => ["tournaments.gender" => "equal"]])
						  ->autoSort(['tournaments.date', 'desc'])
						  ->autoPaginate(10);

And this is my url:
tournament?filter%5Btournaments.season_id%5D=1

And this is the query that is generated:

select `tournaments`.* from `tournaments` left join `divisions` on `divisions`.`id` = `tournaments`.`division_id` left join `seasons` on `seasons`.`id` = `tournaments`.`season_id` where `tournaments`.`deleted_at` is null and tournaments.season_id = 4 order by `tournaments`.`date` desc limit 10 offset 0

Autosort by relationship

Hi,

Is it possible to sort by relationship? For example, I have author model and post model.

I am in post index page with a list of all the posts. I want to sort by author->name. Would that be possible?

Thanks,

Make the icons clickable instead of the column name

Hey,

It's me again. I was wondering if you were thinking to add a way to make the icons of the columns clickable. Right now, to sort, you have to click on the column name (Name, Age, etc.) but would it be possible to make the arrows next to the names sort? And then make the anchor text not a link anymore. Right now, the config 'clickable_icon' true but there is no way to make the anchor text, just a text.

THanks,

THanks,

AutoSetDefaultField

Hi,

I updated and using the autoSetDefaultField() but it still doesn't work.

Here is my code:

Auto::setDefaultField('teams.season_id', getCurrentSeason()->id);

        $query = Team::select('teams.*')->leftJoin(
            "categories", "categories.id", "=",
            "teams.category_id"
        )->leftJoin(
            "divisions", "divisions.id", "=",
            "teams.division_id"
        )->leftJoin(
            "seasons", "seasons.id", "=",
            "teams.season_id"
        );

        if (isAnResponsible($member->role)) {
            $association = Association::byMember($member->id)->first();
            $teamsId = Team::where('association_id', $association->id)->pluck('id');

            $query->whereIn('teams.id', $teamsId);
        } else if (isAnCoach($member->role)) {
            $query->leftJoin(
                "members_teams", "members_teams.team_id", "=",
                "teams.id"
            )->where('members_teams.member_id', '=', $member->id)
            ->where('members_teams.role', '=', 'head-coach');
        }

        if (!is_null($member->role)) {
            return $query->autoWhere(["columns" => ["teams.gender" => "equal"]])->autoSort(['categories.name', 'asc'])
                ->autoPaginate();
        } else {
            return abort(401);
        }

But the teams.season_id is not set to 4...

Autowhere are not filtering

Hi,

This is my url:
member?filter%5Bmembers.first_name%5D=steph&filter%5Bmembers.gender%5D=F&sort=members.gender&order=asc

But this is the sql I get:
"select * from memberswhere true andmembers.deleted_atis null order bymembers.gender asc"

Here is the code:

dd(Member::autoWhere(["columns" => ["gender" => "equal"]])->autoSort(['members.last_name', 'asc'])->toSql());

Thanks,

Autowhere filters not matching for select

Hi,

I have a select box for auto filtering like this:

@inject('tableService', 'App\Services\TableService')

<select name="teams.season_id" class="form-control input-filter">
    @foreach($tableService->seasonsSelect(true) as $id => $season)
        <option value="{{ $id }}" selected="@autowherefilter('teams.season_id', $id)">{{ $season }}</option>
    @endforeach
</select>

The filter works fine, like the data is the correct data. But the selected= is set on every options. Like this:
screen shot 2017-06-19 at 6 27 36 pm

The fix should be like this:

<option value="{{ $id }}" @autowherefilter('teams.season_id', $id)>{{ $season }}</option>

AutoPaginate error with Laravel 5.5

There is an error now on the file: AutoPaginateBlade.php on line 54.

This is the error:

Caused by
BadMethodCallException: Method appends does not exist.

Thanks,

Default filter

Hi,

Is it possible to load the a list with having a default autoWhere(). For example, I want the list to do a where season_id = 1 by default for example.

Is that possible?

Autowhere in views not working

I have these columns:

<th><input type="text" class="form-control" name="name" value="@autowherefilter('name')"></th>
        <th>
            <select name="category_id">
                <option value="1" selected="@autowherefilter('category_id', 1)">Portfolio 1</option>
                <option value="2" selected="@autowherefilter('category_id', 2)">Portfolio 2</option>
                <option value="3" selected="@autowherefilter('category_id', 3)">Portfolio 3</option>
            </select>
        </th>
        <th></th>
        <th></th>
        <th class="tc"><button class="btn btn-primary btn-filter"><i class="fa fa-search" aria-hidden="true"></i></button></th>

Every time I select a option or I type something, I can't send the where. I click on the button, but it doesn't do anything...

@autowherefilter for range of date

Good day!

Is there some example of how to use @autowherefilter for date range filtering?
Or maybe it is possible to implement this functionality?

Thanks in advance.

AutoWhere() for string enum column

Hi,

So I have a Enum column ['M', 'F'] and I am trying to use the autoWhere on it.

In my url, it says: team?filter%5Bteams.gender%5D=3

But, it doesn't filter. This is the sql:

select `teams`.* from `teams` left join `categories` on `categories`.`id` = `teams`.`category_id` left join `divisions` on `divisions`.`id` = `teams`.`division_id` left join `seasons` on `seasons`.`id` = `teams`.`season_id` where true and `teams`.`deleted_at` is null order by `categories`.`name` asc limit 10 offset 0

I am not sure, what is wrong? If I change the url to teams.slug, it filters... So I am not sure if it's because it's a enum column

Name search not mysql safe

Hi, when you search for l' There is an sql error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%') AND teams.season_id = 6' at line 1 (SQL: select count(*) as aggregate from `teams` left join `categories` on `categories`.`id` = `teams`.`category_id` left join `divisions` on `divisions`.`id` = `teams`.`division_id` left join `seasons` on `seasons`.`id` = `teams`.`season_id` where `teams`.`deleted_at` is null and (UPPER(teams.name) LIKE '%L'%') AND teams.season_id = 6)

I think that's because you are not escaping the string... Is it possible to fix it please :)

Thanks,

Target is not instantiable.

Hi,

I followed the instructions but I get this error:

Target [Auto\Contracts\AutoInterface] is not instantiable.

Any ideas why?

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.