Giter Club home page Giter Club logo

Comments (3)

haruncpi avatar haruncpi commented on May 28, 2024 1

No, because itโ€™s not UI scaffold package. You can make your views with custom design by using logs table and model.

from laravel-user-activity.

IAmShafqatAli avatar IAmShafqatAli commented on May 28, 2024

No, because itโ€™s not UI scaffold package. You can make your views with custom design by using logs table and model.

Alright, perfect thank you so much for your reply. :)

from laravel-user-activity.

nopedev avatar nopedev commented on May 28, 2024

In my case I just wanted a little css style customizing, so I copied vendor/haruncpi/laravel-user-activity/views/index.blade.php file to views/vendor/LaravelUserActivity/index.blade.php and replaced strings that I wanted to change.

And I created simple artisan command which copies and updates the vendor view file when the package has updated.

  1. make command
php artisan make:command CustomizeLaravelUserActivityView
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class CustomizeLaravelUserActivityView extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'custom:customize-laravel-user-activity-view';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Customize Laravel User Activity View index.php file';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $from = base_path('vendor/haruncpi/laravel-user-activity/views/index.blade.php');
        $to = resource_path('views/vendor/LaravelUserActivity/index.blade.php');

        $file = file_get_contents($from);

        // page title tag
        $file = str_replace(
            "<title>User Activity</title>",
            "<title>User Activity - {{ config('app.name') }}</title>",
            $file);

        // table td font size
        $file = str_replace(
            "table th,table td{padding:6px 6px;font-size:15px;color:#666}",
            "table th,table td{padding:6px 6px;font-size:13px;color:#666;word-break:break-all;}",
            $file);
        $file = str_replace(
            ".changed{background:antiquewhite}",
            ".changed{background:antiquewhite;max-width: 500px;}",
            $file);

        // preview popup
        $file = str_replace(
            '<div class="popup" style="width: 60%">',
            '<div class="popup" style="width: 90%">',
            $file);
        $file = str_replace(
            "max-height:calc(100vh - 35%);overflow-x:hidden;overflow-y:scroll}",
            "max-height:calc(100vh - 30%);overflow-x:hidden;overflow-y:scroll}",
            $file);

        file_put_contents($to, $file);

        $this->info('LaravelUserActivity view file has customized successfully.');
    }
}
  1. In composer.json register as post-update-cmd script.
    ...
    "scripts": {
        ...
        "post-update-cmd": [
            ...
            "@php artisan custom:customize-laravel-user-activity-view"
            ...
        ]
        ...
    }
    ...

Not the best or elegant way, but I`m satisfied with this. ๐Ÿ˜

from laravel-user-activity.

Related Issues (20)

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.